pub struct InvocationId(/* private fields */);Expand description
A typed wrapper around a single execution or turn identifier.
§Examples
use adk_core::identity::InvocationId;
// Parse from a known value
let iid = InvocationId::try_from("inv-001").unwrap();
assert_eq!(iid.as_ref(), "inv-001");
// Or generate a new UUID-based invocation ID
let generated = InvocationId::generate();
assert!(!generated.as_ref().is_empty());Implementations§
Source§impl InvocationId
impl InvocationId
Sourcepub fn new(value: impl Into<String>) -> Result<InvocationId, IdentityError>
pub fn new(value: impl Into<String>) -> Result<InvocationId, IdentityError>
Creates a typed identifier with validation.
Prefer this constructor at trust boundaries where the input may come from users, HTTP payloads, or external systems.
Sourcepub fn new_unchecked(value: impl Into<String>) -> InvocationId
pub fn new_unchecked(value: impl Into<String>) -> InvocationId
Source§impl InvocationId
impl InvocationId
Sourcepub fn generate() -> InvocationId
pub fn generate() -> InvocationId
Generates a new random invocation identifier using UUID v4.
§Examples
use adk_core::identity::InvocationId;
let a = InvocationId::generate();
let b = InvocationId::generate();
assert_ne!(a, b);Trait Implementations§
Source§impl AsRef<str> for InvocationId
impl AsRef<str> for InvocationId
Source§impl Borrow<str> for InvocationId
impl Borrow<str> for InvocationId
Source§impl Clone for InvocationId
impl Clone for InvocationId
Source§fn clone(&self) -> InvocationId
fn clone(&self) -> InvocationId
Returns a duplicate 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 InvocationId
impl Debug for InvocationId
Source§impl<'de> Deserialize<'de> for InvocationId
impl<'de> Deserialize<'de> for InvocationId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InvocationId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InvocationId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for InvocationId
impl Display for InvocationId
Source§impl FromStr for InvocationId
impl FromStr for InvocationId
Source§type Err = IdentityError
type Err = IdentityError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<InvocationId, <InvocationId as FromStr>::Err>
fn from_str(s: &str) -> Result<InvocationId, <InvocationId as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for InvocationId
impl Hash for InvocationId
Source§impl Ord for InvocationId
impl Ord for InvocationId
Source§fn cmp(&self, other: &InvocationId) -> Ordering
fn cmp(&self, other: &InvocationId) -> 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 InvocationId
impl PartialEq for InvocationId
Source§impl PartialOrd for InvocationId
impl PartialOrd for InvocationId
Source§impl Serialize for InvocationId
impl Serialize for InvocationId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&str> for InvocationId
impl TryFrom<&str> for InvocationId
Source§type Error = IdentityError
type Error = IdentityError
The type returned in the event of a conversion error.
Source§fn try_from(
s: &str,
) -> Result<InvocationId, <InvocationId as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<InvocationId, <InvocationId as TryFrom<&str>>::Error>
Performs the conversion.
Source§impl TryFrom<String> for InvocationId
impl TryFrom<String> for InvocationId
Source§type Error = IdentityError
type Error = IdentityError
The type returned in the event of a conversion error.
Source§fn try_from(
s: String,
) -> Result<InvocationId, <InvocationId as TryFrom<String>>::Error>
fn try_from( s: String, ) -> Result<InvocationId, <InvocationId as TryFrom<String>>::Error>
Performs the conversion.
impl Eq for InvocationId
impl StructuralPartialEq for InvocationId
Auto Trait Implementations§
impl Freeze for InvocationId
impl RefUnwindSafe for InvocationId
impl Send for InvocationId
impl Sync for InvocationId
impl Unpin for InvocationId
impl UnsafeUnpin for InvocationId
impl UnwindSafe for InvocationId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.