pub struct Key<F>where
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> Key<F>where
F: Family,
impl<F> Key<F>where
F: Family,
Sourcepub const fn new_unchecked(raw: HandlerKey) -> Key<F>
pub const fn new_unchecked(raw: HandlerKey) -> Key<F>
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> AsRef<HandlerKey> for Key<F>where
F: Family,
impl<F> AsRef<HandlerKey> for Key<F>where
F: Family,
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> Deserialize<'de> for Key<F>where
F: Family,
impl<'de, F> Deserialize<'de> for Key<F>where
F: Family,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Key<F>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Key<F>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<F> Eq for Key<F>where
F: Family,
Source§impl<F> From<Key<F>> for HandlerKeywhere
F: Family,
impl<F> From<Key<F>> for HandlerKeywhere
F: Family,
Source§fn from(key: Key<F>) -> HandlerKey
fn from(key: Key<F>) -> HandlerKey
Converts to this type from the input type.
Source§impl<F> Ord for Key<F>where
F: Family,
impl<F> Ord for Key<F>where
F: Family,
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> PartialOrd for Key<F>where
F: Family,
impl<F> PartialOrd for Key<F>where
F: Family,
Source§impl<F> Serialize for Key<F>where
F: Family,
impl<F> Serialize for Key<F>where
F: Family,
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
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
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> 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> 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.