Skip to main content

DirectReturnSpec

Struct DirectReturnSpec 

Source
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: bool

Implementations§

Source§

impl DirectReturnSpec

Source

pub fn classify( method: &HybridMethodSpec, spec: &HybridFileSpec, ) -> DirectReturnSpec

Source

pub fn ok_uses_sink(&self) -> bool

True when the Ok payload crosses via a byte-sink callback (NvBytesSink).

Source

pub fn returns_status_i32(&self) -> bool

True when the C function returns i32 (NvModStatus / negative custom error code).

Source

pub fn uses_sync_ok_sink(&self) -> bool

True when a synchronous call takes an (on_ok: NvBytesSink, ok_ctx: *mut c_void) pair.

Source

pub fn uses_sync_err_sink(&self) -> bool

True when a synchronous call takes an (on_err: NvBytesSink, err_ctx: *mut c_void) pair.

Source

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.

Source

pub fn is_option_ok(&self) -> bool

True when status == 1 (NV_MOD_OK_NONE) encodes Ok(None).

Source

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).

Source

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.

Source

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).

Source

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

Source§

fn clone(&self) -> DirectReturnSpec

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 Debug for DirectReturnSpec

Source§

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

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

impl Eq for DirectReturnSpec

Source§

impl PartialEq for DirectReturnSpec

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DirectReturnSpec

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.