Struct reproto_core::translator::Context
[−]
[src]
pub struct Context<T> { pub type_translator: T, pub types: Rc<LinkedHashMap<RpName, RpReg>>, pub decls: RefCell<LinkedHashMap<RpName, RpReg>>, }
Context used when translating.
Fields
type_translator: T
Type used to translate types.
types: Rc<LinkedHashMap<RpName, RpReg>>
Registered declarations of the source type.
decls: RefCell<LinkedHashMap<RpName, RpReg>>
Cached and translated registered declarations.
Trait Implementations
impl<T> Translator for Context<T> where
T: TypeTranslator<Source = CoreFlavor>,
[src]
T: TypeTranslator<Source = CoreFlavor>,
type Source = CoreFlavor
type Target = T::Target
fn visit(&self, name: &RpName) -> Result<()>
[src]
Indicate that the given name has been visited.
fn translate_type(
&self,
source: <Self::Source as Flavor>::Type
) -> Result<<Self::Target as Flavor>::Type>
[src]
&self,
source: <Self::Source as Flavor>::Type
) -> Result<<Self::Target as Flavor>::Type>
Translate the given type from one flavor to another.
fn translate_field(
&self,
source: <Self::Source as Flavor>::Field
) -> Result<<Self::Target as Flavor>::Field>
[src]
&self,
source: <Self::Source as Flavor>::Field
) -> Result<<Self::Target as Flavor>::Field>
Translate the given field from one flavor to another.
fn translate_endpoint(
&self,
source: <Self::Source as Flavor>::Endpoint
) -> Result<<Self::Target as Flavor>::Endpoint>
[src]
&self,
source: <Self::Source as Flavor>::Endpoint
) -> Result<<Self::Target as Flavor>::Endpoint>
Translate the given endpoint from one flavor to another.