Skip to main content

CppConstantAttr

Trait CppConstantAttr 

Source
pub trait CppConstantAttr: Attribute {
    // Required methods
    fn as_f64(&self, ctx: &Context) -> f64;
    fn to_cpp(&self, ctx: &Context) -> String;

    // Provided method
    fn verify(_op: &dyn Attribute, _ctx: &Context) -> Result<()>
       where Self: Sized { ... }
}

Required Methods§

Source

fn as_f64(&self, ctx: &Context) -> f64

Source

fn to_cpp(&self, ctx: &Context) -> String

Provided Methods§

Source

fn verify(_op: &dyn Attribute, _ctx: &Context) -> Result<()>
where Self: Sized,

Trait Implementations§

Source§

impl AttrInterfaceMarker for dyn CppConstantAttr

Source§

impl Eq for dyn CppConstantAttr

Source§

impl Hash for dyn CppConstantAttr

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl Parsable for Box<dyn CppConstantAttr>

Source§

type Arg = ()

Type of the argument that must be passed to the parser.
Source§

type Parsed = Box<dyn CppConstantAttr>

The type of the parsed entity.
Source§

fn parse<'a>( state_stream: &mut StateStream<'a>, _arg: Self::Arg, ) -> ParseResult<'a, Self::Parsed>

Define a parser using existing combinators and call into on Parser::parse_stream to get the final ParseResult. Use state_stream.state as necessary.
Source§

fn parser<'a>( arg: Self::Arg, ) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>
where Self::Parsed: 'a,

Get a parser combinator that can work on StateStream as its input.
Source§

impl PartialEq for dyn CppConstantAttr

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Printable for Box<dyn CppConstantAttr>

Source§

fn fmt(&self, ctx: &Context, state: &State, f: &mut Formatter<'_>) -> Result

Source§

fn disp<'t, 'c>(&'t self, ctx: &'c Context) -> Box<dyn Display + 'c>
where 't: 'c,

Get a Display’able object from the given Context and default State.
Source§

fn print<'t, 'c>( &'t self, ctx: &'c Context, state: &State, ) -> Box<dyn Display + 'c>
where 't: 'c,

Get a Display’able object from the given Context and State.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CppConstantAttr for BoolAttr

Source§

fn as_f64(&self, _ctx: &Context) -> f64

Source§

fn to_cpp(&self, _ctx: &Context) -> String

Source§

impl CppConstantAttr for ComplexAttr

Source§

fn as_f64(&self, ctx: &Context) -> f64

Source§

fn to_cpp(&self, ctx: &Context) -> String

Source§

impl CppConstantAttr for FloatAttr

Source§

fn as_f64(&self, ctx: &Context) -> f64

Source§

fn to_cpp(&self, ctx: &Context) -> String

Source§

impl CppConstantAttr for IndexAttr

Source§

fn as_f64(&self, _ctx: &Context) -> f64

Source§

fn to_cpp(&self, _ctx: &Context) -> String

Source§

impl CppConstantAttr for IntegerAttr

Source§

fn as_f64(&self, _ctx: &Context) -> f64

Source§

fn to_cpp(&self, ctx: &Context) -> String

Source§

impl CppConstantAttr for ZeroAttr

Source§

fn as_f64(&self, _ctx: &Context) -> f64

Source§

fn to_cpp(&self, _ctx: &Context) -> String

Implementors§