Skip to main content

Event

Enum Event 

Source
pub enum Event {
Show 36 variants TextMessageStart(TextMessageStartEvent), TextMessageContent(TextMessageContentEvent), TextMessageEnd(TextMessageEndEvent), TextMessageChunk(TextMessageChunkEvent), ToolCallStart(ToolCallStartEvent), ToolCallArgs(ToolCallArgsEvent), ToolCallEnd(ToolCallEndEvent), ToolCallChunk(ToolCallChunkEvent), ToolCallResult(ToolCallResultEvent), ThinkingStart(ThinkingStartEvent), ThinkingEnd(ThinkingEndEvent), ThinkingTextMessageStart(ThinkingTextMessageStartEvent), ThinkingTextMessageContent(ThinkingTextMessageContentEvent), ThinkingTextMessageEnd(ThinkingTextMessageEndEvent), StateSnapshot(StateSnapshotEvent), StateDelta(StateDeltaEvent), MessagesSnapshot(MessagesSnapshotEvent), ActivitySnapshot(ActivitySnapshotEvent), ActivityDelta(ActivityDeltaEvent), Raw(RawEvent), Custom(CustomEvent), RunStarted(RunStartedEvent), RunFinished(RunFinishedEvent), RunError(RunErrorEvent), StepStarted(StepStartedEvent), StepFinished(StepFinishedEvent), ReasoningStart(ReasoningStartEvent), ReasoningMessageStart(ReasoningMessageStartEvent), ReasoningMessageContent(ReasoningMessageContentEvent), ReasoningMessageEnd(ReasoningMessageEndEvent), ReasoningMessageChunk(ReasoningMessageChunkEvent), ReasoningEnd(ReasoningEndEvent), ReasoningEncryptedValue(ReasoningEncryptedValueEvent), SubagentStarted(SubagentStartedEvent), SubagentFinished(SubagentFinishedEvent), SubagentError(SubagentErrorEvent),
}
Expand description

One event in an AG-UI stream.

Serializes as the payload’s fields plus a type discriminator, so there is no nesting on the wire.

§Exhaustive on purpose

This enum is deliberately not #[non_exhaustive], unlike every error type in this workspace. A new protocol event should be a compile error where you match on events: that is what a typed SDK buys you over serde_json::Value, and the alternative — a _ arm in every consumer — is exactly how the previous Rust SDK came to be missing eight event types without anyone noticing.

The consequence is that adding an event is a major version of this crate. That is the intended price; see docs/DESIGN.md.

Variants§

§

TextMessageStart(TextMessageStartEvent)

Opens a text message. See TextMessageStartEvent.

§

TextMessageContent(TextMessageContentEvent)

Appends to a text message. See TextMessageContentEvent.

§

TextMessageEnd(TextMessageEndEvent)

Closes a text message. See TextMessageEndEvent.

§

TextMessageChunk(TextMessageChunkEvent)

A whole text update in one event. See TextMessageChunkEvent.

§

ToolCallStart(ToolCallStartEvent)

Opens a tool call. See ToolCallStartEvent.

§

ToolCallArgs(ToolCallArgsEvent)

Appends tool-call arguments. See ToolCallArgsEvent.

§

ToolCallEnd(ToolCallEndEvent)

Closes a tool call. See ToolCallEndEvent.

§

ToolCallChunk(ToolCallChunkEvent)

A whole tool call in one event. See ToolCallChunkEvent.

§

ToolCallResult(ToolCallResultEvent)

A tool call’s result. See ToolCallResultEvent.

§

ThinkingStart(ThinkingStartEvent)

Opens a thinking block. See ThinkingStartEvent.

§

ThinkingEnd(ThinkingEndEvent)

Closes a thinking block. See ThinkingEndEvent.

§

ThinkingTextMessageStart(ThinkingTextMessageStartEvent)

Opens a thinking message. See ThinkingTextMessageStartEvent.

§

ThinkingTextMessageContent(ThinkingTextMessageContentEvent)

Appends thinking text. See ThinkingTextMessageContentEvent.

§

ThinkingTextMessageEnd(ThinkingTextMessageEndEvent)

Closes a thinking message. See ThinkingTextMessageEndEvent.

§

StateSnapshot(StateSnapshotEvent)

Replaces the shared state. See StateSnapshotEvent.

§

StateDelta(StateDeltaEvent)

Patches the shared state. See StateDeltaEvent.

§

MessagesSnapshot(MessagesSnapshotEvent)

Replaces the message history. See MessagesSnapshotEvent.

§

ActivitySnapshot(ActivitySnapshotEvent)

Publishes an activity. See ActivitySnapshotEvent.

§

ActivityDelta(ActivityDeltaEvent)

Patches an activity. See ActivityDeltaEvent.

§

Raw(RawEvent)

Forwards a provider event. See RawEvent.

§

Custom(CustomEvent)

An application-defined event. See CustomEvent.

§

RunStarted(RunStartedEvent)

Starts a run. See RunStartedEvent.

§

RunFinished(RunFinishedEvent)

Finishes or pauses a run. See RunFinishedEvent.

§

RunError(RunErrorEvent)

Fails a run. See RunErrorEvent.

§

StepStarted(StepStartedEvent)

Starts a step. See StepStartedEvent.

§

StepFinished(StepFinishedEvent)

Finishes a step. See StepFinishedEvent.

§

ReasoningStart(ReasoningStartEvent)

Opens a reasoning block. See ReasoningStartEvent.

§

ReasoningMessageStart(ReasoningMessageStartEvent)

Opens a reasoning message. See ReasoningMessageStartEvent.

§

ReasoningMessageContent(ReasoningMessageContentEvent)

Appends reasoning text. See ReasoningMessageContentEvent.

§

ReasoningMessageEnd(ReasoningMessageEndEvent)

Closes a reasoning message. See ReasoningMessageEndEvent.

§

ReasoningMessageChunk(ReasoningMessageChunkEvent)

A whole reasoning update in one event. See ReasoningMessageChunkEvent.

§

ReasoningEnd(ReasoningEndEvent)

Closes a reasoning block. See ReasoningEndEvent.

§

ReasoningEncryptedValue(ReasoningEncryptedValueEvent)

Carries an encrypted reasoning blob. See ReasoningEncryptedValueEvent.

§

SubagentStarted(SubagentStartedEvent)

Announces a subagent invocation. See SubagentStartedEvent.

§

SubagentFinished(SubagentFinishedEvent)

Closes a subagent invocation. See SubagentFinishedEvent.

§

SubagentError(SubagentErrorEvent)

Fails a subagent invocation. See SubagentErrorEvent.

Implementations§

Source§

impl Event

Source

pub fn text_message_start( message_id: impl Into<MessageId>, role: TextMessageRole, ) -> Self

TEXT_MESSAGE_START — opens a text message.

Source

pub fn text_message_content( message_id: impl Into<MessageId>, delta: impl Into<String>, ) -> Self

TEXT_MESSAGE_CONTENT — appends text to an open message.

Source

pub fn text_message_end(message_id: impl Into<MessageId>) -> Self

TEXT_MESSAGE_END — closes a text message.

Source

pub fn text_message_chunk( message_id: Option<MessageId>, delta: Option<String>, ) -> Self

TEXT_MESSAGE_CHUNK — a whole text update in one event.

Source

pub fn tool_call_start( tool_call_id: impl Into<ToolCallId>, tool_call_name: impl Into<String>, ) -> Self

TOOL_CALL_START — opens a tool call.

Source

pub fn tool_call_args( tool_call_id: impl Into<ToolCallId>, delta: impl Into<String>, ) -> Self

TOOL_CALL_ARGS — appends argument JSON to an open call.

Source

pub fn tool_call_end(tool_call_id: impl Into<ToolCallId>) -> Self

TOOL_CALL_END — closes a tool call.

Source

pub fn tool_call_chunk( tool_call_id: Option<ToolCallId>, tool_call_name: Option<String>, delta: Option<String>, ) -> Self

TOOL_CALL_CHUNK — a whole tool call in one event.

Source

pub fn tool_call_result( message_id: impl Into<MessageId>, tool_call_id: impl Into<ToolCallId>, content: impl Into<String>, ) -> Self

TOOL_CALL_RESULT — reports what a tool returned.

Source

pub fn thinking_start(title: Option<String>) -> Self

👎Deprecated:

use Event::reasoning_start

THINKING_START — opens a thinking block.

Source

pub fn thinking_end() -> Self

👎Deprecated:

use Event::reasoning_end

THINKING_END — closes a thinking block.

Source

pub fn thinking_text_message_start() -> Self

👎Deprecated:

use Event::reasoning_message_start

THINKING_TEXT_MESSAGE_START — opens a thinking message.

Source

pub fn thinking_text_message_content(delta: impl Into<String>) -> Self

👎Deprecated:

use Event::reasoning_message_content

THINKING_TEXT_MESSAGE_CONTENT — appends thinking text.

Source

pub fn thinking_text_message_end() -> Self

👎Deprecated:

use Event::reasoning_message_end

THINKING_TEXT_MESSAGE_END — closes a thinking message.

Source

pub fn state_snapshot(snapshot: impl Into<Value>) -> Self

STATE_SNAPSHOT — replaces the shared state.

Source

pub fn state_delta(delta: impl Into<Vec<PatchOperation>>) -> Self

STATE_DELTA — patches the shared state.

Source

pub fn messages_snapshot(messages: impl Into<Vec<Message>>) -> Self

MESSAGES_SNAPSHOT — replaces the message history.

Source

pub fn activity_snapshot( message_id: impl Into<MessageId>, activity_type: impl Into<String>, content: JsonObject, ) -> Self

ACTIVITY_SNAPSHOT — publishes an activity payload.

Source

pub fn activity_delta( message_id: impl Into<MessageId>, activity_type: impl Into<String>, patch: impl Into<Vec<PatchOperation>>, ) -> Self

ACTIVITY_DELTA — patches an activity payload.

Source

pub fn raw(event: impl Into<Value>) -> Self

RAW — forwards a provider event verbatim.

Source

pub fn custom(name: impl Into<String>, value: impl Into<Value>) -> Self

CUSTOM — an application-defined event.

Source

pub fn run_started( thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>, ) -> Self

RUN_STARTED — starts a run.

Source

pub fn run_finished( thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>, ) -> Self

RUN_FINISHED without an outcome — the legacy shape, which consumers read as success.

Source

pub fn run_finished_success( thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>, ) -> Self

RUN_FINISHED with an explicit success outcome.

Source

pub fn run_finished_interrupt( thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>, interrupts: impl Into<Vec<Interrupt>>, ) -> Self

RUN_FINISHED with an interrupt outcome — the run is paused until the client answers.

Source

pub fn run_error(message: impl Into<String>) -> Self

RUN_ERROR — fails the run.

Source

pub fn step_started(step_name: impl Into<StepName>) -> Self

STEP_STARTED — opens a named step.

Source

pub fn step_finished(step_name: impl Into<StepName>) -> Self

STEP_FINISHED — closes a named step.

Source

pub fn reasoning_start(message_id: impl Into<MessageId>) -> Self

REASONING_START — opens a reasoning block.

Source

pub fn reasoning_message_start(message_id: impl Into<MessageId>) -> Self

REASONING_MESSAGE_START — opens a reasoning message.

Source

pub fn reasoning_message_content( message_id: impl Into<MessageId>, delta: impl Into<String>, ) -> Self

REASONING_MESSAGE_CONTENT — appends reasoning text.

Source

pub fn reasoning_message_end(message_id: impl Into<MessageId>) -> Self

REASONING_MESSAGE_END — closes a reasoning message.

Source

pub fn reasoning_message_chunk( message_id: Option<MessageId>, delta: Option<String>, ) -> Self

REASONING_MESSAGE_CHUNK — a whole reasoning update in one event.

Source

pub fn reasoning_end(message_id: impl Into<MessageId>) -> Self

REASONING_END — closes a reasoning block.

Source

pub fn reasoning_encrypted_value( subtype: ReasoningEncryptedValueSubtype, entity_id: impl Into<String>, encrypted_value: impl Into<String>, ) -> Self

REASONING_ENCRYPTED_VALUE — carries an opaque reasoning blob.

Source

pub fn subagent_started( subagent_run_id: impl Into<SubagentRunId>, name: impl Into<String>, ) -> Self

SUBAGENT_STARTED — announces a subagent invocation.

Source

pub fn subagent_finished(subagent_run_id: impl Into<SubagentRunId>) -> Self

SUBAGENT_FINISHED without an outcome — the legacy shape, which consumers read as success.

Source

pub fn subagent_finished_success( subagent_run_id: impl Into<SubagentRunId>, ) -> Self

SUBAGENT_FINISHED with an explicit success outcome.

Source

pub fn subagent_finished_suspended( subagent_run_id: impl Into<SubagentRunId>, interrupt_ids: impl Into<Vec<String>>, ) -> Self

SUBAGENT_FINISHED with a suspended outcome — the subagent is waiting on the named interrupts.

Source

pub fn subagent_error( subagent_run_id: impl Into<SubagentRunId>, message: impl Into<String>, ) -> Self

SUBAGENT_ERROR — fails a subagent invocation.

Source§

impl Event

Source

pub const fn event_type(&self) -> EventType

The discriminator for this event.

Source

pub const fn base(&self) -> &BaseEvent

The timestamp and raw-event fields, whatever the variant.

Source

pub const fn base_mut(&mut self) -> &mut BaseEvent

Mutable access to the timestamp and raw-event fields.

Source§

impl Event

Source

pub fn with_timestamp(self, timestamp: i64) -> Self

Stamps the event with a millisecond Unix timestamp.

Source

pub fn with_raw_event(self, raw_event: impl Into<Value>) -> Self

Attaches the provider event this was translated from.

Source

pub fn with_metadata(self, metadata: JsonObject) -> Self

Attaches metadata, replacing any the event already carried. See crate::metadata.

Source

pub const fn metadata(&self) -> Option<&JsonObject>

The event’s metadata, if it carries any.

Source

pub const fn is_deprecated(&self) -> bool

Whether this event’s type is deprecated in favour of a REASONING_* one.

Source

pub fn subagent_run_id(&self) -> Option<&SubagentRunId>

The subagent this event belongs to.

None means the parent agent — or an event type that carries no attribution at all; EventType::is_attributable tells the two apart. For the three SUBAGENT_* lifecycle events this is the subagent they announce, which is required rather than optional.

Source

pub fn set_subagent_run_id(&mut self, id: impl Into<SubagentRunId>) -> bool

Attributes the event to id.

Returns false, leaving the event untouched, for the nine event types the protocol defines without the field: RUN_*, MESSAGES_SNAPSHOT and the deprecated THINKING_* family. On a SUBAGENT_* event it sets the subject.

Source

pub fn clear_subagent_run_id(&mut self) -> Option<SubagentRunId>

Removes attribution from an attributable event and returns it.

The SUBAGENT_* events carry their id as a required subject, so this leaves them alone and returns None, as it does for the event types that never carry the field.

Source

pub fn with_subagent_run_id(self, id: impl Into<SubagentRunId>) -> Self

Builder form of set_subagent_run_id; a no-op on the event types that cannot carry attribution.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for Event

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

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 From<ActivityDeltaEvent> for Event

Source§

fn from(payload: ActivityDeltaEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ActivitySnapshotEvent> for Event

Source§

fn from(payload: ActivitySnapshotEvent) -> Self

Converts to this type from the input type.
Source§

impl From<CustomEvent> for Event

Source§

fn from(payload: CustomEvent) -> Self

Converts to this type from the input type.
Source§

impl From<MessagesSnapshotEvent> for Event

Source§

fn from(payload: MessagesSnapshotEvent) -> Self

Converts to this type from the input type.
Source§

impl From<RawEvent> for Event

Source§

fn from(payload: RawEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningEncryptedValueEvent> for Event

Source§

fn from(payload: ReasoningEncryptedValueEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningEndEvent> for Event

Source§

fn from(payload: ReasoningEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningMessageChunkEvent> for Event

Source§

fn from(payload: ReasoningMessageChunkEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningMessageContentEvent> for Event

Source§

fn from(payload: ReasoningMessageContentEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningMessageEndEvent> for Event

Source§

fn from(payload: ReasoningMessageEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningMessageStartEvent> for Event

Source§

fn from(payload: ReasoningMessageStartEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ReasoningStartEvent> for Event

Source§

fn from(payload: ReasoningStartEvent) -> Self

Converts to this type from the input type.
Source§

impl From<RunErrorEvent> for Event

Source§

fn from(payload: RunErrorEvent) -> Self

Converts to this type from the input type.
Source§

impl From<RunFinishedEvent> for Event

Source§

fn from(payload: RunFinishedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<RunStartedEvent> for Event

Source§

fn from(payload: RunStartedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<StateDeltaEvent> for Event

Source§

fn from(payload: StateDeltaEvent) -> Self

Converts to this type from the input type.
Source§

impl From<StateSnapshotEvent> for Event

Source§

fn from(payload: StateSnapshotEvent) -> Self

Converts to this type from the input type.
Source§

impl From<StepFinishedEvent> for Event

Source§

fn from(payload: StepFinishedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<StepStartedEvent> for Event

Source§

fn from(payload: StepStartedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<SubagentErrorEvent> for Event

Source§

fn from(payload: SubagentErrorEvent) -> Self

Converts to this type from the input type.
Source§

impl From<SubagentFinishedEvent> for Event

Source§

fn from(payload: SubagentFinishedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<SubagentStartedEvent> for Event

Source§

fn from(payload: SubagentStartedEvent) -> Self

Converts to this type from the input type.
Source§

impl From<TextMessageChunkEvent> for Event

Source§

fn from(payload: TextMessageChunkEvent) -> Self

Converts to this type from the input type.
Source§

impl From<TextMessageContentEvent> for Event

Source§

fn from(payload: TextMessageContentEvent) -> Self

Converts to this type from the input type.
Source§

impl From<TextMessageEndEvent> for Event

Source§

fn from(payload: TextMessageEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<TextMessageStartEvent> for Event

Source§

fn from(payload: TextMessageStartEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ThinkingEndEvent> for Event

Source§

fn from(payload: ThinkingEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ThinkingStartEvent> for Event

Source§

fn from(payload: ThinkingStartEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ThinkingTextMessageContentEvent> for Event

Source§

fn from(payload: ThinkingTextMessageContentEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ThinkingTextMessageEndEvent> for Event

Source§

fn from(payload: ThinkingTextMessageEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ThinkingTextMessageStartEvent> for Event

Source§

fn from(payload: ThinkingTextMessageStartEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ToolCallArgsEvent> for Event

Source§

fn from(payload: ToolCallArgsEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ToolCallChunkEvent> for Event

Source§

fn from(payload: ToolCallChunkEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ToolCallEndEvent> for Event

Source§

fn from(payload: ToolCallEndEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ToolCallResultEvent> for Event

Source§

fn from(payload: ToolCallResultEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ToolCallStartEvent> for Event

Source§

fn from(payload: ToolCallStartEvent) -> Self

Converts to this type from the input type.
Source§

impl JsonSchema for Event

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Source§

impl ToSchema for Event

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more