pub struct GraphDecoder<'a> { /* private fields */ }Expand description
Decoder for a single flat wire::SchemaGraph that holds several
independent root types (the agent-layer carrier produced by
crate::schema::wit::GraphEncoder). Decodes the shared defs once and
then any type-node-index into a recursive SchemaType.
Implementations§
Source§impl<'a> GraphDecoder<'a>
impl<'a> GraphDecoder<'a>
pub fn new(wire_graph: &'a SchemaGraph) -> Result<GraphDecoder<'a>, DecodeError>
Sourcepub fn decode_defs(&self) -> Result<Vec<SchemaTypeDef>, DecodeError>
pub fn decode_defs(&self) -> Result<Vec<SchemaTypeDef>, DecodeError>
Decode the graph’s named definitions. The resulting SchemaGraph uses
these defs together with a placeholder root (matching
SchemaGraph::empty); the agent-layer carriers never consult root.
Sourcepub fn decode_type_at(&self, idx: i32) -> Result<SchemaType, DecodeError>
pub fn decode_type_at(&self, idx: i32) -> Result<SchemaType, DecodeError>
Decode the (possibly recursive) schema type rooted at idx.
Auto Trait Implementations§
impl<'a> !Freeze for GraphDecoder<'a>
impl<'a> !RefUnwindSafe for GraphDecoder<'a>
impl<'a> !Sync for GraphDecoder<'a>
impl<'a> Send for GraphDecoder<'a>
impl<'a> Unpin for GraphDecoder<'a>
impl<'a> UnsafeUnpin for GraphDecoder<'a>
impl<'a> UnwindSafe for GraphDecoder<'a>
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
Mutably borrows from an owned value. Read more