[−][src]Struct gvariant::NonFixedWidthArray
Type with same representation as GVariant "aX" type where X is any non-fixed size type
This is similar to a slice
, but for non-fixed width types,
and implements many of the same methods. Items can be retrieved by indexing
or iterated over.
For fixed-width types a standard rust slice is used.
Implementations
impl<T: Cast + ?Sized> NonFixedWidthArray<T>
[src]
pub fn len(&self) -> usize
[src]
Returns the number of elements in the array.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the array has a length of 0.
pub fn iter(&self) -> NonFixedWidthArrayIterator<T>ⓘImportant traits for NonFixedWidthArrayIterator<'a, Item>
impl<'a, Item: Cast + 'static + ?Sized> Iterator for NonFixedWidthArrayIterator<'a, Item> type Item = &'a Item;
[src]
Important traits for NonFixedWidthArrayIterator<'a, Item>
impl<'a, Item: Cast + 'static + ?Sized> Iterator for NonFixedWidthArrayIterator<'a, Item> type Item = &'a Item;
Returns an iterator over the array.
pub fn first(&self) -> Option<&T>
[src]
Returns the first element of the array, or None
if it is empty.
pub fn last(&self) -> Option<&T>
[src]
Returns the last element of the array, or None
if it is empty.
Trait Implementations
impl<T: Cast + ?Sized> AlignOf for NonFixedWidthArray<T>
[src]
impl<T: Cast + ?Sized> AllBitPatternsValid for NonFixedWidthArray<T>
[src]
impl<T: Cast + ?Sized> Cast for NonFixedWidthArray<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 NonFixedWidthArray<T>
[src]
impl<T: Cast + PartialEq + Eq + ?Sized> Eq for NonFixedWidthArray<T>
[src]
impl<Item: Cast + 'static + ?Sized> Index<usize> for NonFixedWidthArray<Item>
[src]
type Output = Item
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a, Item: Cast + 'static + ?Sized> IntoIterator for &'a NonFixedWidthArray<Item>
[src]
type Item = &'a Item
The type of the elements being iterated over.
type IntoIter = NonFixedWidthArrayIterator<'a, Item>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'_, Item: Cast + ?Sized + PartialEq<T>, T: ?Sized> PartialEq<[&'_ T]> for NonFixedWidthArray<Item>
[src]
impl<'_, Item: Cast + ?Sized + PartialEq<T>, T: ?Sized> PartialEq<NonFixedWidthArray<Item>> for [&'_ T]
[src]
fn eq(&self, other: &NonFixedWidthArray<Item>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Cast + PartialEq + ?Sized> PartialEq<NonFixedWidthArray<T>> for NonFixedWidthArray<T>
[src]
impl<T: Cast + ?Sized> RefCast for NonFixedWidthArray<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, It: IntoIterator> SerializeTo<NonFixedWidthArray<GvT>> for It where
It::Item: SerializeTo<GvT>,
[src]
It::Item: SerializeTo<GvT>,
impl<T: Cast + ?Sized> ToOwned for NonFixedWidthArray<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for NonFixedWidthArray<T> where
<T as AlignOf>::AlignOf: RefUnwindSafe,
<T as AlignOf>::AlignOf: RefUnwindSafe,
impl<T: ?Sized> Send for NonFixedWidthArray<T> where
<T as AlignOf>::AlignOf: Send,
<T as AlignOf>::AlignOf: Send,
impl<T: ?Sized> Sync for NonFixedWidthArray<T> where
<T as AlignOf>::AlignOf: Sync,
<T as AlignOf>::AlignOf: Sync,
impl<T: ?Sized> Unpin for NonFixedWidthArray<T> where
<T as AlignOf>::AlignOf: Unpin,
<T as AlignOf>::AlignOf: Unpin,
impl<T: ?Sized> UnwindSafe for NonFixedWidthArray<T> where
<T as AlignOf>::AlignOf: 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, It> SerializeTo<NonFixedWidthArray<GvT>> for It where
GvT: Cast + ?Sized,
It: IntoIterator,
<It as IntoIterator>::Item: SerializeTo<GvT>,
[src]
GvT: Cast + ?Sized,
It: IntoIterator,
<It as IntoIterator>::Item: SerializeTo<GvT>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,