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