Struct glib::enums::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>,

§

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.