[−][src]Struct gvariant::MaybeNonFixedSize
Type with same representation as GVariant "mX" type where X is any non-fixed size type
This is the type returned by:
gv!("ms").cast(data); gv!("mmi").cast(data); gv!("m(ias)").cast(data);
Rust's built in Option
doesn't have any specified byte representation so
we need our own type here.
Maybes are encoded differently depending on if their element type is
fixed-sized or not. MaybeFixedSize
is used when the contained size is
fixed, but it implements the same interface as this type.
Implementations
impl<T: Cast + ?Sized> MaybeNonFixedSize<T>
[src]
pub fn to_option(&self) -> Option<&T>
[src]
Convert to a rust native Option
type.
Note: this doesn't copy the data, it returns an option to a reference to the underlying data.
Trait Implementations
impl<T: Cast + ?Sized> AlignOf for MaybeNonFixedSize<T>
[src]
impl<T: Cast + ?Sized> AllBitPatternsValid for MaybeNonFixedSize<T>
[src]
impl<T: Cast + ?Sized> Cast for MaybeNonFixedSize<T>
[src]
fn default_ref() -> &'static Self
[src]
fn try_from_aligned_slice(
slice: &AlignedSlice<Self::AlignOf>
) -> Result<&Self, WrongSize>
[src]
slice: &AlignedSlice<Self::AlignOf>
) -> Result<&Self, WrongSize>
fn try_from_aligned_slice_mut(
slice: &mut AlignedSlice<Self::AlignOf>
) -> Result<&mut Self, WrongSize>
[src]
slice: &mut AlignedSlice<Self::AlignOf>
) -> Result<&mut Self, WrongSize>
fn from_aligned_slice(slice: &AlignedSlice<Self::AlignOf>) -> &Self
[src]
impl<T: Cast + Debug + ?Sized> Debug for MaybeNonFixedSize<T>
[src]
impl<T: Cast + Eq + ?Sized> Eq for MaybeNonFixedSize<T>
[src]
impl<'a, T: Cast + ?Sized> From<&'a MaybeNonFixedSize<T>> for Option<&'a T>
[src]
fn from(m: &'a MaybeNonFixedSize<T>) -> Self
[src]
impl<'a, T: Cast + ?Sized> IntoIterator for &'a MaybeNonFixedSize<T>
[src]
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = IntoIter<&'a T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T: Cast + PartialEq + ?Sized> PartialEq<MaybeNonFixedSize<T>> for MaybeNonFixedSize<T>
[src]
impl<T: Cast + PartialEq, '_> PartialEq<MaybeNonFixedSize<T>> for Option<&'_ T>
[src]
fn eq(&self, other: &MaybeNonFixedSize<T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Cast + PartialEq, '_> PartialEq<Option<&'_ T>> for MaybeNonFixedSize<T>
[src]
impl<T: Cast + ?Sized> RefCast for MaybeNonFixedSize<T>
[src]
type From = AlignedSlice<T::AlignOf>
fn ref_cast(_from: &Self::From) -> &Self
[src]
fn ref_cast_mut(_from: &mut Self::From) -> &mut Self
[src]
impl<GvT: Cast + ?Sized, T: IntoIterator> SerializeTo<MaybeNonFixedSize<GvT>> for T where
T::Item: SerializeTo<GvT>,
[src]
T::Item: SerializeTo<GvT>,
impl<T: Cast + ?Sized> ToOwned for MaybeNonFixedSize<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for MaybeNonFixedSize<T> where
T: RefUnwindSafe,
<T as AlignOf>::AlignOf: RefUnwindSafe,
T: RefUnwindSafe,
<T as AlignOf>::AlignOf: RefUnwindSafe,
impl<T: ?Sized> Send for MaybeNonFixedSize<T> where
T: Send,
<T as AlignOf>::AlignOf: Send,
T: Send,
<T as AlignOf>::AlignOf: Send,
impl<T: ?Sized> Sync for MaybeNonFixedSize<T> where
T: Sync,
<T as AlignOf>::AlignOf: Sync,
T: Sync,
<T as AlignOf>::AlignOf: Sync,
impl<T: ?Sized> Unpin for MaybeNonFixedSize<T> where
T: Unpin,
<T as AlignOf>::AlignOf: Unpin,
T: Unpin,
<T as AlignOf>::AlignOf: Unpin,
impl<T: ?Sized> UnwindSafe for MaybeNonFixedSize<T> where
T: UnwindSafe,
<T as AlignOf>::AlignOf: UnwindSafe,
T: UnwindSafe,
<T as AlignOf>::AlignOf: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<GvT, T> SerializeTo<MaybeNonFixedSize<GvT>> for T where
GvT: Cast + ?Sized,
T: IntoIterator,
<T as IntoIterator>::Item: SerializeTo<GvT>,
[src]
GvT: Cast + ?Sized,
T: IntoIterator,
<T as IntoIterator>::Item: SerializeTo<GvT>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,