pub enum Type<'a> {
Bool,
Int,
Float,
String,
ForeignObject,
Any,
Optional(TypeRef<'a>),
Array(TypeRef<'a>),
Map(TypeRef<'a>),
Custom(&'a str),
Enum(List<'a, EnumVariant<'a>>),
Object(List<'a, Field<'a>>),
}Expand description
Represents a type in Varlink IDL.
Variants§
Bool
Boolean type.
Int
64-bit signed integer.
Float
64-bit floating point.
String
UTF-8 string.
ForeignObject
Foreign untyped object.
Any
Any JSON value (systemd extension).
Optional(TypeRef<'a>)
Optional/nullable type.
Array(TypeRef<'a>)
Array type.
Map(TypeRef<'a>)
Map type with string keys.
Custom(&'a str)
Custom named type reference.
Enum(List<'a, EnumVariant<'a>>)
Inline enum type.
Object(List<'a, Field<'a>>)
Inline struct type.
Implementations§
Source§impl<'a> Type<'a>
impl<'a> Type<'a>
Sourcepub const fn as_optional(&self) -> Option<&TypeRef<'a>>
pub const fn as_optional(&self) -> Option<&TypeRef<'a>>
The child type if this type is optional.
Sourcepub const fn as_array(&self) -> Option<&TypeRef<'a>>
pub const fn as_array(&self) -> Option<&TypeRef<'a>>
The array element type if this type is an array.
Sourcepub const fn as_custom(&self) -> Option<&'a str>
pub const fn as_custom(&self) -> Option<&'a str>
The custom type name if this type is a custom type.
Sourcepub const fn as_enum(&self) -> Option<&List<'a, EnumVariant<'a>>>
pub const fn as_enum(&self) -> Option<&List<'a, EnumVariant<'a>>>
The enum variants if this type is an enum.
Trait Implementations§
Source§impl<'a> PartialEq<TypeRef<'a>> for Type<'a>
impl<'a> PartialEq<TypeRef<'a>> for Type<'a>
impl<'a> Eq for Type<'a>
impl<'a> StructuralPartialEq for Type<'a>
Auto Trait Implementations§
impl<'a> Freeze for Type<'a>
impl<'a> RefUnwindSafe for Type<'a>
impl<'a> Send for Type<'a>
impl<'a> Sync for Type<'a>
impl<'a> Unpin for Type<'a>
impl<'a> UnsafeUnpin for Type<'a>
impl<'a> UnwindSafe for Type<'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