pub struct ChatItemId(/* private fields */);Expand description
Stable identifier of one ordered message or status item.
Values are opaque strings. ChatItemId::new performs no validation.
§Examples
use ailloli_ui_core::ChatItemId;
let id = ChatItemId::new("provider-item-42");
assert_eq!(id.as_str(), "provider-item-42");Implementations§
Source§impl ChatItemId
impl ChatItemId
Sourcepub fn new(value: impl Into<String>) -> Self
pub fn new(value: impl Into<String>) -> Self
Wraps an opaque identifier exactly as supplied.
Empty strings and provider-specific formats are accepted.
§Examples
use ailloli_ui_core::ChatSessionId;
assert_eq!(ChatSessionId::new("provider-42").as_str(), "provider-42");Sourcepub fn from_index(index: u64) -> Self
pub fn from_index(index: u64) -> Self
Builds a deterministic ID from a zero-based or monotonic index.
The representation is the type-specific prefix, an underscore, and exactly 16 lowercase hexadecimal digits.
§Examples
use ailloli_ui_core::ChatSessionId;
assert_eq!(ChatSessionId::from_index(1).as_str(), "chat_session_0000000000000001");Trait Implementations§
Source§impl Clone for ChatItemId
impl Clone for ChatItemId
Source§fn clone(&self) -> ChatItemId
fn clone(&self) -> ChatItemId
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatItemId
impl Debug for ChatItemId
Source§impl<'de> Deserialize<'de> for ChatItemId
impl<'de> Deserialize<'de> for ChatItemId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ChatItemId
impl Display for ChatItemId
Source§impl Hash for ChatItemId
impl Hash for ChatItemId
Source§impl Ord for ChatItemId
impl Ord for ChatItemId
Source§fn cmp(&self, other: &ChatItemId) -> Ordering
fn cmp(&self, other: &ChatItemId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ChatItemId
impl PartialEq for ChatItemId
Source§impl PartialOrd for ChatItemId
impl PartialOrd for ChatItemId
Source§impl Serialize for ChatItemId
impl Serialize for ChatItemId
impl Eq for ChatItemId
impl StructuralPartialEq for ChatItemId
Auto Trait Implementations§
impl Freeze for ChatItemId
impl RefUnwindSafe for ChatItemId
impl Send for ChatItemId
impl Sync for ChatItemId
impl Unpin for ChatItemId
impl UnwindSafe for ChatItemId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more