pub struct GeneratorContext<'a> {
    pub request: Reader<'a>,
    pub node_map: HashMap<u64, Reader<'a>>,
    pub scope_map: HashMap<u64, Vec<String>>,
    pub node_parents: HashMap<u64, u64>,
    pub capnp_root: String,
}

Fields§

§request: Reader<'a>§node_map: HashMap<u64, Reader<'a>>§scope_map: HashMap<u64, Vec<String>>§node_parents: HashMap<u64, u64>

Map from node ID to the node ID of its parent scope. This is equal to node.scope_id for all nodes except for autogenerated interface Param and Result structs; those have scope_id set to 0. See the comment on paramStructType in schema.capnp.

§capnp_root: String

Root path for referencing things in the capnp crate from the generated code.

Implementations§

source§

impl<'a> GeneratorContext<'a>

source

pub fn new(message: &'a Reader<OwnedSegments>) -> Result<GeneratorContext<'a>>

source

pub fn get_qualified_module(&self, type_id: u64) -> String

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GeneratorContext<'a>

§

impl<'a> !Send for GeneratorContext<'a>

§

impl<'a> !Sync for GeneratorContext<'a>

§

impl<'a> Unpin for GeneratorContext<'a>

§

impl<'a> !UnwindSafe for GeneratorContext<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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.