glib::enums

Struct EnumerationValuesStorage

Source
#[repr(C)]
pub struct EnumerationValuesStorage<E: EnumerationValue<E>, const S: usize>(/* private fields */);
Expand description

Storage of enumeration values terminated by a zero value. Should be used only as a storage location for EnumValue or FlagsValue when registering an enum or flags as a dynamic type. see TypePluginRegisterImpl::register_dynamic_enum(), TypePluginRegisterImpl::register_dynamic_flags() and TypePluginImpl::complete_type_info(). Inner is intentionally private to ensure other modules will not access the enum (or flags) values by this way. Use EnumClass::values() or EnumClass::value() to get the enum values. Use FlagsClass::values() or FlagsClass::value() to get the flags values.

Implementations§

Source§

impl<E: EnumerationValue<E>, const S: usize> EnumerationValuesStorage<E, S>

Source

pub const fn new<const N: usize>(values: [E; N]) -> Self

creates a new EnumerationValuesStorage with the given values and a final zero value.

Trait Implementations§

Source§

impl<E: EnumerationValue<E>, const S: usize> AsRef<EnumerationValues<E>> for EnumerationValuesStorage<E, S>

Source§

fn as_ref(&self) -> &EnumerationValues<E>

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

§

impl<E, const S: usize> Freeze for EnumerationValuesStorage<E, S>
where E: Freeze,

§

impl<E, const S: usize> RefUnwindSafe for EnumerationValuesStorage<E, S>
where E: RefUnwindSafe,

§

impl<E, const S: usize> Send for EnumerationValuesStorage<E, S>
where E: Send,

§

impl<E, const S: usize> Sync for EnumerationValuesStorage<E, S>
where E: Sync,

§

impl<E, const S: usize> Unpin for EnumerationValuesStorage<E, S>
where E: Unpin,

§

impl<E, const S: usize> UnwindSafe for EnumerationValuesStorage<E, S>
where E: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.