pub struct Key<F: Family> { /* private fields */ }Expand description
A handler key tagged with its effect family. Serializes as the underlying
string without the family tag. Deserialization and Self::new_unchecked
do not validate a registration; hosts must ensure the key serves F.
Implements Send + Sync independently of F.
Implementations§
Source§impl<F: Family> Key<F>
impl<F: Family> Key<F>
Sourcepub const fn new_unchecked(raw: HandlerKey) -> Self
pub const fn new_unchecked(raw: HandlerKey) -> Self
Assert that raw serves F. The one place a family is asserted
rather than proven: for a host that registered the handler itself
and knows what it serves. A wrong assertion fails at bind time
(HandlerUnavailable) or at the first dispatch, not silently.
Sourcepub const fn raw(&self) -> &HandlerKey
pub const fn raw(&self) -> &HandlerKey
The wire key.
Sourcepub fn into_raw(self) -> HandlerKey
pub fn into_raw(self) -> HandlerKey
The wire key, by value.
Trait Implementations§
Source§impl<F: Family> AsRef<HandlerKey> for Key<F>
impl<F: Family> AsRef<HandlerKey> for Key<F>
Source§fn as_ref(&self) -> &HandlerKey
fn as_ref(&self) -> &HandlerKey
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de, F: Family> Deserialize<'de> for Key<F>
impl<'de, F: Family> Deserialize<'de> for Key<F>
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
impl<F: Family> Eq for Key<F>
Source§impl<F: Family> Ord for Key<F>
impl<F: Family> Ord for Key<F>
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<F: Family> PartialOrd for Key<F>
impl<F: Family> PartialOrd for Key<F>
Auto Trait Implementations§
impl<F> Freeze for Key<F>
impl<F> RefUnwindSafe for Key<F>
impl<F> Send for Key<F>
impl<F> Sync for Key<F>
impl<F> Unpin for Key<F>
impl<F> UnsafeUnpin for Key<F>
impl<F> UnwindSafe for Key<F>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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> 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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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.