pub struct DirectReturnSpec {
pub ok: DirectOkKind,
pub err: DirectErrKind,
pub is_async: bool,
}Expand description
Complete lowered return contract for a Direct-First method.
Fields§
§ok: DirectOkKind§err: DirectErrKind§is_async: boolImplementations§
Source§impl DirectReturnSpec
impl DirectReturnSpec
pub fn classify( method: &HybridMethodSpec, spec: &HybridFileSpec, ) -> DirectReturnSpec
Sourcepub fn ok_uses_sink(&self) -> bool
pub fn ok_uses_sink(&self) -> bool
True when the Ok payload crosses via a byte-sink callback (NvBytesSink).
Sourcepub fn returns_status_i32(&self) -> bool
pub fn returns_status_i32(&self) -> bool
True when the C function returns i32 (NvModStatus / negative custom error code).
Sourcepub fn uses_sync_ok_sink(&self) -> bool
pub fn uses_sync_ok_sink(&self) -> bool
True when a synchronous call takes an (on_ok: NvBytesSink, ok_ctx: *mut c_void) pair.
Sourcepub fn uses_sync_err_sink(&self) -> bool
pub fn uses_sync_err_sink(&self) -> bool
True when a synchronous call takes an (on_err: NvBytesSink, err_ctx: *mut c_void) pair.
Sourcepub fn sync_out_pod(&self) -> Option<&HybridType>
pub fn sync_out_pod(&self) -> Option<&HybridType>
Returns the inner POD type when a synchronous call writes its Ok value through out: *mut Raw.
Sourcepub fn is_option_ok(&self) -> bool
pub fn is_option_ok(&self) -> bool
True when status == 1 (NV_MOD_OK_NONE) encodes Ok(None).
Sourcepub fn wasm_direct_scalar_ok(&self) -> bool
pub fn wasm_direct_scalar_ok(&self) -> bool
True when the wasm32 direct export returns void or a single numeric scalar directly
(zero out-pointer, zero sink callback).
Sourcepub fn wasm_sync_out_scalar(&self) -> Option<&HybridType>
pub fn wasm_sync_out_scalar(&self) -> Option<&HybridType>
Returns the inner non-struct, fixed-width POD scalar type when a synchronous wasm32 direct
export writes its Ok value through out_ok: *mut RawScalar.
Excludes HybridType::Usize because usize is 4 bytes on wasm32 while fixed_wire_size
is 8 bytes; routing fallible usize through the wire sink avoids pointer-width mismatch and
uninitialized heap reads across JS linear memory.
Sourcepub fn wasm_uses_sync_ok_sink(&self) -> bool
pub fn wasm_uses_sync_ok_sink(&self) -> bool
True when a synchronous wasm32 direct export delivers its Ok payload through an integer
on_ok_cb: u32 sink handle (covers Str/Bytes/wire types, POD structs, and infallible
OptPod so wasm32 never relies on C struct padding across JS linear memory).
Sourcepub fn ok_hybrid_type<'a>(&self, method: &'a HybridMethodSpec) -> &'a HybridType
pub fn ok_hybrid_type<'a>(&self, method: &'a HybridMethodSpec) -> &'a HybridType
The underlying ok HybridType (unwrapped from Result<ok, err>).
Trait Implementations§
Source§impl Clone for DirectReturnSpec
impl Clone for DirectReturnSpec
Source§fn clone(&self) -> DirectReturnSpec
fn clone(&self) -> DirectReturnSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more