Trait reproto_core::translator::Translator
[−]
[src]
pub trait Translator { type Source: 'static + Flavor; type Target: 'static + Flavor; fn translate_package(
&self,
_: <Self::Source as Flavor>::Package
) -> Result<<Self::Target as Flavor>::Package>; fn translate_type(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Type
) -> Result<<Self::Target as Flavor>::Type>; fn translate_field(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Field
) -> Result<<Self::Target as Flavor>::Field>; fn translate_endpoint(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Endpoint
) -> Result<<Self::Target as Flavor>::Endpoint>; fn translate_local_name(
&self,
diag: &mut Diagnostics,
reg: RpReg,
name: <Self::Source as Flavor>::Name
) -> Result<<Self::Target as Flavor>::Name>; fn translate_enum_type(
&self,
diag: &mut Diagnostics,
enum_type: <Self::Source as Flavor>::EnumType
) -> Result<<Self::Target as Flavor>::EnumType>; fn visit(
&self,
_: &mut Diagnostics,
_: &<Self::Source as Flavor>::Name
) -> Result<()> { ... } }
Translator trait from one flavor to another.
Associated Types
Required Methods
fn translate_package(
&self,
_: <Self::Source as Flavor>::Package
) -> Result<<Self::Target as Flavor>::Package>
&self,
_: <Self::Source as Flavor>::Package
) -> Result<<Self::Target as Flavor>::Package>
Translate the given package from one flavor to another.
fn translate_type(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Type
) -> Result<<Self::Target as Flavor>::Type>
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Type
) -> Result<<Self::Target as Flavor>::Type>
Translate the given type from one flavor to another.
fn translate_field(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Field
) -> Result<<Self::Target as Flavor>::Field>
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Field
) -> Result<<Self::Target as Flavor>::Field>
Translate the given field from one flavor to another.
fn translate_endpoint(
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Endpoint
) -> Result<<Self::Target as Flavor>::Endpoint>
&self,
diag: &mut Diagnostics,
_: <Self::Source as Flavor>::Endpoint
) -> Result<<Self::Target as Flavor>::Endpoint>
Translate the given endpoint from one flavor to another.
fn translate_local_name(
&self,
diag: &mut Diagnostics,
reg: RpReg,
name: <Self::Source as Flavor>::Name
) -> Result<<Self::Target as Flavor>::Name>
&self,
diag: &mut Diagnostics,
reg: RpReg,
name: <Self::Source as Flavor>::Name
) -> Result<<Self::Target as Flavor>::Name>
Translate a local declaration name.
fn translate_enum_type(
&self,
diag: &mut Diagnostics,
enum_type: <Self::Source as Flavor>::EnumType
) -> Result<<Self::Target as Flavor>::EnumType>
&self,
diag: &mut Diagnostics,
enum_type: <Self::Source as Flavor>::EnumType
) -> Result<<Self::Target as Flavor>::EnumType>
Enum type to translate.
Provided Methods
fn visit(
&self,
_: &mut Diagnostics,
_: &<Self::Source as Flavor>::Name
) -> Result<()>
&self,
_: &mut Diagnostics,
_: &<Self::Source as Flavor>::Name
) -> Result<()>
Indicate that the given name has been visited.
Implementors
impl<T> Translator for Context<T> where
T: FlavorTranslator<Source = CoreFlavor>, type Source = T::Source; type Target = T::Target;