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§
Sourceconst NEEDS_PREPARATION: bool = true
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§
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Provided Methods§
fn preflight(&self, _resources: &mut WirePreflight) -> Result<(), WireError>
Sourceasync fn prepare_wire(&self) -> Result<(), WireError>
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.
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 ()
impl IntoWire for ()
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
fn write_result_payload( &self, _writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>
Source§impl IntoWire for DateTime<Utc>
impl IntoWire for DateTime<Utc>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for Duration
impl IntoWire for Duration
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for PathBuf
impl IntoWire for PathBuf
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for String
impl IntoWire for String
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for bool
impl IntoWire for bool
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for char
impl IntoWire for char
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for f32
impl IntoWire for f32
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for f64
impl IntoWire for f64
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for i8
impl IntoWire for i8
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for i16
impl IntoWire for i16
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for i32
impl IntoWire for i32
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for i64
impl IntoWire for i64
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for str
impl IntoWire for str
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for u8
impl IntoWire for u8
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for u16
impl IntoWire for u16
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for u32
impl IntoWire for u32
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for u64
impl IntoWire for u64
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl IntoWire for usize
impl IntoWire for usize
const NEEDS_PREPARATION: bool = false
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C, D, E, F, G, H> IntoWire for (A, B, C, D, E, F, G, H)
impl<A, B, C, D, E, F, G, H> IntoWire for (A, B, C, D, E, F, G, H)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C, D, E, F, G> IntoWire for (A, B, C, D, E, F, G)
impl<A, B, C, D, E, F, G> IntoWire for (A, B, C, D, E, F, G)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C, D, E, F> IntoWire for (A, B, C, D, E, F)
impl<A, B, C, D, E, F> IntoWire for (A, B, C, D, E, F)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C, D, E> IntoWire for (A, B, C, D, E)
impl<A, B, C, D, E> IntoWire for (A, B, C, D, E)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C, D> IntoWire for (A, B, C, D)
impl<A, B, C, D> IntoWire for (A, B, C, D)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B, C> IntoWire for (A, B, C)
impl<A, B, C> IntoWire for (A, B, C)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A, B> IntoWire for (A, B)
impl<A, B> IntoWire for (A, B)
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<A> IntoWire for (A,)where
A: IntoWire,
impl<A> IntoWire for (A,)where
A: IntoWire,
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<K, V> IntoWire for BTreeMap<K, V>
impl<K, V> IntoWire for BTreeMap<K, V>
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<K, V> IntoWire for HashMap<K, V>
impl<K, V> IntoWire for HashMap<K, V>
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<T, E> IntoWire for Result<T, E>
impl<T, E> IntoWire for Result<T, E>
const NEEDS_PREPARATION: bool
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<T> IntoWire for &T
impl<T> IntoWire for &T
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>
Source§impl<T> IntoWire for Arc<T>
impl<T> IntoWire for Arc<T>
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>
Source§impl<T> IntoWire for Bound<T>where
T: IntoWire,
impl<T> IntoWire for Bound<T>where
T: IntoWire,
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<T> IntoWire for Box<T>
impl<T> IntoWire for Box<T>
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>
Source§impl<T> IntoWire for HashSet<T>where
T: IntoWire,
impl<T> IntoWire for HashSet<T>where
T: IntoWire,
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<T> IntoWire for Option<T>where
T: IntoWire,
impl<T> IntoWire for Option<T>where
T: IntoWire,
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Source§impl<T> IntoWire for Rc<T>
impl<T> IntoWire for Rc<T>
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_result_payload( &self, writer: &mut WireWriter, ) -> Result<Option<i32>, WireError>
Source§impl<T> IntoWire for Vec<T>where
T: IntoWire,
impl<T> IntoWire for Vec<T>where
T: IntoWire,
const NEEDS_PREPARATION: bool = T::NEEDS_PREPARATION
fn preflight(&self, resources: &mut WirePreflight) -> Result<(), WireError>
async fn prepare_wire(&self) -> Result<(), WireError>
fn write_wire(&self, writer: &mut WireWriter) -> Result<i32, WireError>
Implementors§
impl IntoWire for AccountId
impl IntoWire for AgentAllFilter
impl IntoWire for AgentAnyFilter
impl IntoWire for AgentConfigVarsFilter
impl IntoWire for AgentCreatedAtFilter
impl IntoWire for AgentEnvFilter
impl IntoWire for AgentId
impl IntoWire for AgentMetadata
impl IntoWire for AgentNameFilter
impl IntoWire for AgentPropertyFilter
impl IntoWire for AgentStatus
impl IntoWire for AgentStatusFilter
impl IntoWire for AgentVersionFilter
impl IntoWire for CardId
impl IntoWire for CardView
impl IntoWire for ComponentId
impl IntoWire for EnvironmentId
impl IntoWire for FilterComparator
impl IntoWire for ForkDetails
impl IntoWire for ForkResult
impl IntoWire for GuestPermissionCardHandle
impl IntoWire for GuestQuotaTokenHandle
impl IntoWire for GuestSecretHandle
impl IntoWire for KernelModule
impl IntoWire for PatternGrant
impl IntoWire for PermissionCard
impl IntoWire for PermissionError
impl IntoWire for PolymorphicPermissionCard
impl IntoWire for ProcessExitStatus
impl IntoWire for PromiseId
impl IntoWire for QuotaToken
Source§impl IntoWire for SchemaFingerprintV1
Available on crate feature guest only.
impl IntoWire for SchemaFingerprintV1
Available on crate feature
guest only.