pub enum CustomType<'a> {
Object(CustomObject<'a>),
Enum(CustomEnum<'a>),
}Expand description
A custom type definition in Varlink IDL.
This can be either a struct-like object type with named fields, or an enum-like type with named variants.
Variants§
Object(CustomObject<'a>)
A struct-like custom type with named fields.
Enum(CustomEnum<'a>)
An enum-like custom type with named variants.
Implementations§
Source§impl<'a> CustomType<'a>
impl<'a> CustomType<'a>
Sourcepub fn as_object(&self) -> Option<&CustomObject<'a>>
pub fn as_object(&self) -> Option<&CustomObject<'a>>
Returns the object if this is an object custom type.
Sourcepub fn as_enum(&self) -> Option<&CustomEnum<'a>>
pub fn as_enum(&self) -> Option<&CustomEnum<'a>>
Returns the enum if this is an enum custom type.
Trait Implementations§
Source§impl<'a> Clone for CustomType<'a>
impl<'a> Clone for CustomType<'a>
Source§fn clone(&self) -> CustomType<'a>
fn clone(&self) -> CustomType<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for CustomType<'a>
impl<'a> Debug for CustomType<'a>
Source§impl<'a> Display for CustomType<'a>
impl<'a> Display for CustomType<'a>
Source§impl<'a> From<CustomEnum<'a>> for CustomType<'a>
impl<'a> From<CustomEnum<'a>> for CustomType<'a>
Source§fn from(enm: CustomEnum<'a>) -> CustomType<'a>
fn from(enm: CustomEnum<'a>) -> CustomType<'a>
Converts to this type from the input type.
Source§impl<'a> From<CustomObject<'a>> for CustomType<'a>
impl<'a> From<CustomObject<'a>> for CustomType<'a>
Source§fn from(obj: CustomObject<'a>) -> CustomType<'a>
fn from(obj: CustomObject<'a>) -> CustomType<'a>
Converts to this type from the input type.
Source§impl<'a> PartialEq for CustomType<'a>
impl<'a> PartialEq for CustomType<'a>
Source§fn eq(&self, other: &CustomType<'a>) -> bool
fn eq(&self, other: &CustomType<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Eq for CustomType<'a>
impl<'a> StructuralPartialEq for CustomType<'a>
Auto Trait Implementations§
impl<'a> Freeze for CustomType<'a>
impl<'a> RefUnwindSafe for CustomType<'a>
impl<'a> Send for CustomType<'a>
impl<'a> Sync for CustomType<'a>
impl<'a> Unpin for CustomType<'a>
impl<'a> UnsafeUnpin for CustomType<'a>
impl<'a> UnwindSafe for CustomType<'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