pub struct Maybe<'a> { /* private fields */ }
Expand description
A helper type to wrap Option<T>
(GVariant’s Maybe type) in Value
.
API is provided to convert from, and to Option<T>
.
Implementations§
source§impl<'a> Maybe<'a>
impl<'a> Maybe<'a>
sourcepub fn nothing<'s: 'a>(value_signature: Signature<'s>) -> Self
pub fn nothing<'s: 'a>(value_signature: Signature<'s>) -> Self
Create a new Nothing (None) Maybe
, given the signature of the type.
sourcepub fn signature(&self) -> Signature<'static>
pub fn signature(&self) -> Signature<'static>
Get the signature of Maybe
.
NB: This method potentially allocates and copies. Use full_signature
if you’d like to
avoid that.
sourcepub fn full_signature(&self) -> &Signature<'_>
pub fn full_signature(&self) -> &Signature<'_>
Get the signature of Maybe
.
sourcepub fn value_signature(&self) -> &Signature<'_>
pub fn value_signature(&self) -> &Signature<'_>
Get the signature of the potential value in the Maybe
.
Trait Implementations§
source§impl<'a> Ord for Maybe<'a>
impl<'a> Ord for Maybe<'a>
source§impl<'a> PartialEq for Maybe<'a>
impl<'a> PartialEq for Maybe<'a>
source§impl<'a> PartialOrd for Maybe<'a>
impl<'a> PartialOrd for Maybe<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> TryFrom<&'a OwnedValue> for &'a Maybe<'a>
impl<'a> TryFrom<&'a OwnedValue> for &'a Maybe<'a>
source§impl<'a> TryFrom<Maybe<'a>> for OwnedValue
impl<'a> TryFrom<Maybe<'a>> for OwnedValue
source§impl TryFrom<OwnedValue> for Maybe<'static>
impl TryFrom<OwnedValue> for Maybe<'static>
impl<'a> Eq for Maybe<'a>
impl<'a> StructuralPartialEq for Maybe<'a>
Auto Trait Implementations§
impl<'a> Freeze for Maybe<'a>
impl<'a> RefUnwindSafe for Maybe<'a>
impl<'a> Send for Maybe<'a>
impl<'a> Sync for Maybe<'a>
impl<'a> Unpin for Maybe<'a>
impl<'a> UnwindSafe for Maybe<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more