pub struct FloatAttr {
pub ty: TypeHandle,
pub val: APFloat,
}Fields§
§ty: TypeHandle§val: APFloatImplementations§
Source§impl FloatAttr
impl FloatAttr
Sourcepub fn new(ty: TypeHandle, val: APFloat) -> Self
pub fn new(ty: TypeHandle, val: APFloat) -> Self
Constructs a new FloatAttr.
Source§impl FloatAttr
impl FloatAttr
pub fn as_value<T: NumCast + TypedLiteral>(&self, ctx: &Context) -> Option<T>
pub fn with_value<T: NumCast>(&self, ctx: &Context, new_val: T) -> Self
pub fn from_f64(ctx: &Context, ty: TypeHandle, val: f64) -> Self
pub fn float_type<'a>(&self, ctx: &'a Context) -> Ref<'a, dyn APFloatType>
Trait Implementations§
Source§impl Attribute for FloatAttr
impl Attribute for FloatAttr
Source§fn hash_attr(&self) -> TypeValueHash
fn hash_attr(&self) -> TypeValueHash
Compute and get the hash for this instance of Self.
Hash collisions can be a possibility.
Source§fn get_attr_id(&self) -> AttrId
fn get_attr_id(&self) -> AttrId
Get an Attribute’s static name. This is not per instantnce.
It is mostly useful for printing and parsing the attribute.
Source§fn get_attr_id_static() -> AttrId
fn get_attr_id_static() -> AttrId
Same as get_attr_id, but without the self reference.
Source§impl ConstantAttr for FloatAttr
impl ConstantAttr for FloatAttr
Source§impl MaterializableAttr for FloatAttr
impl MaterializableAttr for FloatAttr
Source§impl Parsable for FloatAttr
impl Parsable for FloatAttr
Source§fn parse<'a>(
input: &mut StateStream<'a>,
_: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( input: &mut StateStream<'a>, _: 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,
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 Printable for FloatAttr
impl Printable for FloatAttr
impl StructuralPartialEq for FloatAttr
Source§impl TypedAttrInterface for FloatAttr
impl TypedAttrInterface for FloatAttr
Source§fn get_type(&self, _ctx: &Context) -> TypeHandle
fn get_type(&self, _ctx: &Context) -> TypeHandle
Get this attribute’s type.
Auto Trait Implementations§
impl Freeze for FloatAttr
impl RefUnwindSafe for FloatAttr
impl Send for FloatAttr
impl Sync for FloatAttr
impl Unpin for FloatAttr
impl UnsafeUnpin for FloatAttr
impl UnwindSafe for FloatAttr
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more