pub struct Stage<M = ()> {
pub function: ItemFn,
pub metadata: M,
}Expand description
One link in a converter’s stage chain —
a value-inspecting step that sits between the rust value the
#[prebindgen] fn yields/receives and the wire-facing
ConverterImpl::function.
Each stage is a fallible In → Result<Out, Err> function. The core
pipeline only ever emits and de-duplicates Self::function; how a
stage’s Err arm is surfaced to the foreign side — throw an exception,
return an error code, set errno, … — is entirely up to the
destination-language adapter and is described by Self::metadata.
Fields§
§function: ItemFnComplete function definition for this stage. Same shape as
ConverterImpl::function but typed for this stage’s own In → Out and own error type.
metadata: MAdapter-specific extras for this stage — same Metadata type as
the owning converter (ConverterImpl::metadata). The core never
inspects this; the adapter’s emitter reads it to decide how the
stage’s Err arm is surfaced (e.g. a JNI adapter stores the JVM
exception class and throw_* fn to call here; a C adapter might
store the error-code sentinel). Defaults to ().
Trait Implementations§
Auto Trait Implementations§
impl<M = ()> !Send for Stage<M>
impl<M = ()> !Sync for Stage<M>
impl<M> Freeze for Stage<M>where
M: Freeze,
impl<M> RefUnwindSafe for Stage<M>where
M: RefUnwindSafe,
impl<M> Unpin for Stage<M>where
M: Unpin,
impl<M> UnsafeUnpin for Stage<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Stage<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more