pub struct AtomicF32(/* private fields */);
Expand description

Atomic f32 based on AtomicU32

Trait Implementations§

source§

impl AsBytes for AtomicF32

source§

const BITS: usize = 32usize

Convenience costant field equal to AsBytes::BYTES * 8.
source§

const BYTES: usize = 4usize

Length in bytes of the representation of the type.
§

type Bytes = [u8; 4]

The byte array that can be use to build the value. It must always be [u8; Self::BYTES] (but with the present Rust syntax we cannot enforce it).
source§

impl Atomic for AtomicF32

§

type NonAtomicType = f32

The non atomic variant of this type
source§

fn new(value: Self::NonAtomicType) -> Self

Creates a new atomic integer.
source§

fn load(&self, order: Ordering) -> Self::NonAtomicType

Loads a value from the atomic integer. Read more
source§

fn store(&self, value: Self::NonAtomicType, order: Ordering)

Stores a value into the atomic integer. load takes an Ordering argument which describes the memory ordering of this operation. Possible values are SeqCst, Release and Relaxed. Read more
source§

fn get_mut(&mut self) -> &mut Self::NonAtomicType

Returns a mutable reference to the underlying integer. Read more
source§

fn into_inner(self) -> Self::NonAtomicType

Consumes the atomic and returns the contained value. Read more
source§

fn into_non_atomic_array<const N: usize>( data: [Self; N] ) -> [Self::NonAtomicType; N]

source§

fn from_non_atomic_array<const N: usize>( data: [Self::NonAtomicType; N] ) -> [Self; N]

source§

fn get_mut_slice(this: &mut [Self]) -> &mut [Self::NonAtomicType]

source§

fn from_mut_slice(this: &mut [Self::NonAtomicType]) -> &mut [Self]

source§

fn get_mut_array<const N: usize>( this: &mut [Self; N] ) -> &mut [Self::NonAtomicType; N]

source§

fn from_mut_array<const N: usize>( this: &mut [Self::NonAtomicType; N] ) -> &mut [Self; N]

source§

fn compare_exchange( &self, current: Self::NonAtomicType, new: Self::NonAtomicType, success: Ordering, failure: Ordering ) -> Result<Self::NonAtomicType, Self::NonAtomicType>

Stores a value into the atomic integer if the current value is the same as the current value. Read more
source§

fn compare_exchange_weak( &self, current: Self::NonAtomicType, new: Self::NonAtomicType, success: Ordering, failure: Ordering ) -> Result<Self::NonAtomicType, Self::NonAtomicType>

Stores a value into the atomic integer if the current value is the same as the current value. Read more
source§

fn swap( &self, value: Self::NonAtomicType, order: Ordering ) -> Self::NonAtomicType

Stores a value into the atomic integer, returning the previous value. Read more
source§

fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<Self::NonAtomicType, Self::NonAtomicType>
where F: FnMut(Self::NonAtomicType) -> Option<Self::NonAtomicType>,

Fetches the value, and applies a function to it that returns an optional new value. Returns a Result of Ok(previous_value) if the function returned Some(_), else Err(previous_value). Read more
source§

impl AtomicNumber for AtomicF32

source§

fn fetch_min( &self, value: Self::NonAtomicType, order: Ordering ) -> Self::NonAtomicType

Minimum with the current value. Read more
source§

fn fetch_max( &self, value: Self::NonAtomicType, order: Ordering ) -> Self::NonAtomicType

Maximum with the current value. Read more
source§

fn fetch_add( &self, value: Self::NonAtomicType, order: Ordering ) -> Self::NonAtomicType

Adds to the current value, returning the previous value. Read more
source§

fn fetch_sub( &self, value: Self::NonAtomicType, order: Ordering ) -> Self::NonAtomicType

Subtracts from the current value, returning the previous value. Read more
source§

impl Debug for AtomicF32

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for AtomicF32

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl IsAtomic for AtomicF32

§

type Atomic = True

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CastableFrom<T> for T

source§

fn cast_from(value: T) -> T

Call Self as W
source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

source§

fn cast(self) -> U

Call W::cast_from(self)
source§

impl<T> DowncastableFrom<T> for T

source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

source§

fn downcast(self) -> U

Call W::downcast_from(self)
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromBytes for T
where T: Atomic + AsBytes, <T as Atomic>::NonAtomicType: FromBytes<Bytes = <T as AsBytes>::Bytes> + AsBytes,

source§

fn from_be_bytes(bytes: <T as AsBytes>::Bytes) -> T

Create a native endian integer value from its representation as a byte array in big endian.
source§

fn from_ne_bytes(bytes: <T as AsBytes>::Bytes) -> T

Create a native endian integer value from its memory representation as a byte array in native endianness. As the target platform’s native endianness is used, portable code likely wants to use from_be_bytes or from_le_bytes, as appropriate instead.
source§

fn from_le_bytes(bytes: <T as AsBytes>::Bytes) -> T

Create a native endian integer value from its representation as a byte array in little endian.
source§

impl<T, U> Into<U> for T
where 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> Splat<T> for T

source§

fn splat(value: T) -> T

source§

impl<T> To<T> for T

source§

fn to(self) -> T

source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<T> UpcastableFrom<T> for T

source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

source§

fn upcast(self) -> U

Call W::upcast_from(self)