pub struct ChatSessionId(/* private fields */);Expand description
Stable identifier of one chat session.
Values are opaque strings. ChatSessionId::new performs no validation.
§Examples
use ailloli_ui_core::ChatSessionId;
assert_eq!(ChatSessionId::from_index(7).as_str(), "chat_session_0000000000000007");Implementations§
Source§impl ChatSessionId
impl ChatSessionId
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 ChatSessionId
impl Clone for ChatSessionId
Source§fn clone(&self) -> ChatSessionId
fn clone(&self) -> ChatSessionId
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 ChatSessionId
impl Debug for ChatSessionId
Source§impl<'de> Deserialize<'de> for ChatSessionId
impl<'de> Deserialize<'de> for ChatSessionId
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 ChatSessionId
impl Display for ChatSessionId
Source§impl Hash for ChatSessionId
impl Hash for ChatSessionId
Source§impl Ord for ChatSessionId
impl Ord for ChatSessionId
Source§fn cmp(&self, other: &ChatSessionId) -> Ordering
fn cmp(&self, other: &ChatSessionId) -> 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 ChatSessionId
impl PartialEq for ChatSessionId
Source§impl PartialOrd for ChatSessionId
impl PartialOrd for ChatSessionId
Source§impl Serialize for ChatSessionId
impl Serialize for ChatSessionId
impl Eq for ChatSessionId
impl StructuralPartialEq for ChatSessionId
Auto Trait Implementations§
impl Freeze for ChatSessionId
impl RefUnwindSafe for ChatSessionId
impl Send for ChatSessionId
impl Sync for ChatSessionId
impl Unpin for ChatSessionId
impl UnwindSafe for ChatSessionId
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