pub struct TypeEntry<M = ()> {
pub destination: Type,
pub function: ItemFn,
pub pre_stages: Vec<Stage<M>>,
pub subs: Vec<TypeKey>,
pub niches: Niches,
pub metadata: M,
}Expand description
Per-cell registry entry.
Fields§
§destination: TypeWire/destination type — the form the value takes on the wire as
chosen by the adapter (e.g. an i64 handle for a JNI adapter, or
a *const T raw pointer for a C adapter). Other converters that
ask “what’s the wire form of this rust type?” read this.
function: ItemFnComplete generated function for the wire-facing stage of the
converter (signature, body, attributes, lifetimes). The adapter
owns the shape. Callers compute this stage’s name via
function.sig.ident.
pre_stages: Vec<Stage<M>>Rust-side stages that compose with Self::function to form
the full chain — copied verbatim from the resolving
crate::prebindgen::ConverterImpl::pre_stages. See
that field’s docs for the chain-order semantics.
subs: Vec<TypeKey>Inner types whose function delegates to their converters. Empty for terminal converters; populated by wrapper converters. Used by the post-resolution propagation pass.
niches: NichesWire bit-patterns this converter never produces / always rejects.
Wrappers (Option<_>, sum-typed enums) carve from this set for
their own discriminants. See Niches for the cascade model.
metadata: MAdapter-specific extras carried in by the
crate::prebindgen::ConverterImpl that filled this
slot. Emitter code reads this directly — the registry is the
single source of truth for cross-language facts (C header names,
JVM class names, etc.). Defaults to () for adapters that don’t
need any.
Implementations§
Source§impl<M> TypeEntry<M>
impl<M> TypeEntry<M>
Sourcepub fn from_converter(c: ConverterImpl<M>) -> Self
pub fn from_converter(c: ConverterImpl<M>) -> Self
The resolved form of what a generator built.
The only difference is subs: a generator names its inners as types,
and the table keys them.
Sourcepub fn converter_ident(&self) -> &Ident
pub fn converter_ident(&self) -> &Ident
Identifier of the wire-facing converter function.
Sourcepub fn input_stage_order(&self) -> impl Iterator<Item = (usize, &Stage<M>)>
pub fn input_stage_order(&self) -> impl Iterator<Item = (usize, &Stage<M>)>
Rust-side stages in input execution order, after the wire-facing converter has decoded the wire value.
Sourcepub fn output_stage_order(&self) -> impl Iterator<Item = (usize, &Stage<M>)>
pub fn output_stage_order(&self) -> impl Iterator<Item = (usize, &Stage<M>)>
Rust-side stages in output execution order, before the wire-facing converter encodes the final wire value.
Sourcepub fn dependency_keys(&self) -> &[TypeKey]
pub fn dependency_keys(&self) -> &[TypeKey]
Immediate converter dependencies recorded by the adapter when this entry resolved.
Trait Implementations§
Auto Trait Implementations§
impl<M = ()> !Send for TypeEntry<M>
impl<M = ()> !Sync for TypeEntry<M>
impl<M> Freeze for TypeEntry<M>where
M: Freeze,
impl<M> RefUnwindSafe for TypeEntry<M>where
M: RefUnwindSafe,
impl<M> Unpin for TypeEntry<M>where
M: Unpin,
impl<M> UnsafeUnpin for TypeEntry<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for TypeEntry<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