Skip to main content

IntoWire

Trait IntoWire 

Source
pub trait IntoWire {
    const NEEDS_PREPARATION: bool = true;

    // Required method
    fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>;

    // Provided methods
    fn preflight(&self, _resources: &mut WirePreflight) -> Result<(), WireError> { ... }
    async fn prepare_wire(&self) -> Result<(), WireError> { ... }
    fn write_result_payload(
        &self,
        writer: &mut WireWriter,
    ) -> Result<Option<i32>, WireError> { ... }
}
Expand description

Encode a concrete value without constructing an owned schema value.

Implementations must visit every resource in preflight before moving any handles in write_wire. After a successful preflight, write_wire must not fail except when a resource was concurrently transferred through an alias.

Provided Associated Constants§

Source

const NEEDS_PREPARATION: bool = true

False only when prepare_wire is a no-op for every value of this type. Resource preflight still runs regardless of this flag. Custom and derived implementations prepare by default, including those with no stream schema.

Required Methods§

Source

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Provided Methods§

Source

fn preflight(&self, _resources: &mut WirePreflight) -> Result<(), WireError>

Source

async fn prepare_wire(&self) -> Result<(), WireError>

Wrap native stream endpoints without reading from them. This is called only after the complete value has passed resource preflight.

Source

fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoWire for ()

Source§

impl IntoWire for DateTime<Utc>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl IntoWire for Duration

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl IntoWire for PathBuf

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl IntoWire for String

Source§

impl IntoWire for bool

Source§

impl IntoWire for char

Source§

impl IntoWire for f32

Source§

impl IntoWire for f64

Source§

impl IntoWire for i8

Source§

impl IntoWire for i16

Source§

impl IntoWire for i32

Source§

impl IntoWire for i64

Source§

impl IntoWire for str

Source§

impl IntoWire for u8

Source§

impl IntoWire for u16

Source§

impl IntoWire for u32

Source§

impl IntoWire for u64

Source§

impl IntoWire for usize

Source§

impl<A, B, C, D, E, F, G, H> IntoWire for (A, B, C, D, E, F, G, H)
where A: IntoWire, B: IntoWire, C: IntoWire, D: IntoWire, E: IntoWire, F: IntoWire, G: IntoWire, H: IntoWire,

Source§

impl<A, B, C, D, E, F, G> IntoWire for (A, B, C, D, E, F, G)
where A: IntoWire, B: IntoWire, C: IntoWire, D: IntoWire, E: IntoWire, F: IntoWire, G: IntoWire,

Source§

impl<A, B, C, D, E, F> IntoWire for (A, B, C, D, E, F)
where A: IntoWire, B: IntoWire, C: IntoWire, D: IntoWire, E: IntoWire, F: IntoWire,

Source§

impl<A, B, C, D, E> IntoWire for (A, B, C, D, E)
where A: IntoWire, B: IntoWire, C: IntoWire, D: IntoWire, E: IntoWire,

Source§

impl<A, B, C, D> IntoWire for (A, B, C, D)
where A: IntoWire, B: IntoWire, C: IntoWire, D: IntoWire,

Source§

impl<A, B, C> IntoWire for (A, B, C)
where A: IntoWire, B: IntoWire, C: IntoWire,

Source§

impl<A, B> IntoWire for (A, B)
where A: IntoWire, B: IntoWire,

Source§

impl<A> IntoWire for (A,)
where A: IntoWire,

Source§

impl<K, V> IntoWire for BTreeMap<K, V>
where K: IntoWire, V: IntoWire,

Source§

impl<K, V> IntoWire for HashMap<K, V>
where K: IntoWire, V: IntoWire,

Source§

impl<T, E> IntoWire for Result<T, E>
where T: IntoWire, E: IntoWire,

Source§

impl<T> IntoWire for &T
where T: IntoWire + ?Sized,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>

Source§

impl<T> IntoWire for Arc<T>
where T: IntoWire + ?Sized,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>

Source§

impl<T> IntoWire for Bound<T>
where T: IntoWire,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl<T> IntoWire for Box<T>
where T: IntoWire + ?Sized,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>

Source§

impl<T> IntoWire for HashSet<T>
where T: IntoWire,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl<T> IntoWire for Option<T>
where T: IntoWire,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

impl<T> IntoWire for Rc<T>
where T: IntoWire + ?Sized,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>

Source§

impl<T> IntoWire for Vec<T>
where T: IntoWire,

Source§

const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION

Source§

fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>

Source§

async fn prepare_wire(&self) -> Result<(), WireError>

Source§

fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>

Implementors§

Source§

impl IntoWire for AccountId

Source§

impl IntoWire for AgentAllFilter

Source§

impl IntoWire for AgentAnyFilter

Source§

impl IntoWire for AgentConfigVarsFilter

Source§

impl IntoWire for AgentCreatedAtFilter

Source§

impl IntoWire for AgentEnvFilter

Source§

impl IntoWire for AgentId

Source§

impl IntoWire for AgentMetadata

Source§

impl IntoWire for AgentNameFilter

Source§

impl IntoWire for AgentPropertyFilter

Source§

impl IntoWire for AgentStatus

Source§

impl IntoWire for AgentStatusFilter

Source§

impl IntoWire for AgentVersionFilter

Source§

impl IntoWire for CardId

Source§

impl IntoWire for CardView

Source§

impl IntoWire for ComponentId

Source§

impl IntoWire for EnvironmentId

Source§

impl IntoWire for FilterComparator

Source§

impl IntoWire for ForkDetails

Source§

impl IntoWire for ForkResult

Source§

impl IntoWire for GuestPermissionCardHandle

Source§

impl IntoWire for GuestQuotaTokenHandle

Source§

impl IntoWire for GuestSecretHandle

Source§

impl IntoWire for KernelModule

Source§

impl IntoWire for PatternGrant

Source§

impl IntoWire for PermissionCard

Source§

impl IntoWire for PermissionError

Source§

impl IntoWire for PolymorphicPermissionCard

Source§

impl IntoWire for ProcessExitStatus

Source§

impl IntoWire for PromiseId

Source§

impl IntoWire for QuotaToken

Source§

impl IntoWire for SchemaFingerprintV1

Available on crate feature guest only.
Source§

impl IntoWire for SchemaValueStream

Source§

impl IntoWire for StringFilterComparator

Source§

impl IntoWire for Timestamp

Source§

impl IntoWire for UpdateMode

Source§

impl IntoWire for Uuid

Source§

impl<U> IntoWire for Quantity<U>
where U: QuantityUnit,