pub enum RustType {
Show 17 variants
Bool,
I8(Range<i8>),
U8(Range<u8>),
I16(Range<i16>),
U16(Range<u16>),
I32(Range<i32>),
U32(Range<u32>),
I64(Range<i64>),
U64(Range<Option<u64>>),
String(Size<usize>, Charset),
VecU8(Size<usize>),
BitVec(Size<usize>),
Vec(Box<RustType, Global>, Size<usize>, EncodingOrdering),
Null,
Option(Box<RustType, Global>),
Default(Box<RustType, Global>, LiteralValue),
Complex(String, Option<Tag>),
}
Expand description
Integers are ordered where Ixx < Uxx so
that when comparing two instances RustType
and a > b, then the integer type of a can
use ::from(..) to cast from b
Variants§
Bool
I8(Range<i8>)
U8(Range<u8>)
I16(Range<i16>)
U16(Range<u16>)
I32(Range<i32>)
U32(Range<u32>)
I64(Range<i64>)
U64(Range<Option<u64>>)
String(Size<usize>, Charset)
VecU8(Size<usize>)
BitVec(Size<usize>)
Vec(Box<RustType, Global>, Size<usize>, EncodingOrdering)
Null
Option(Box<RustType, Global>)
Default(Box<RustType, Global>, LiteralValue)
Complex(String, Option<Tag>)
Indicates a complex, custom type that is not one of rusts known types. This can be thought of as a “ReferenceType”; declaring usage, but not being declared here
Implementations§
source§impl RustType
impl RustType
pub fn as_inner_type(&self) -> &RustType
pub fn into_inner_type(self) -> RustType
pub fn to_inner_type_string(&self) -> String
pub fn no_option(self) -> RustType
pub fn as_no_option(&self) -> &RustType
pub fn is_vec(&self) -> bool
sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Values which might not be serialized according to ASN
pub fn is_primitive(&self) -> bool
pub fn integer_range_str(&self) -> Option<Range<String>>
pub fn into_asn(self) -> Type<Resolved>
pub fn similar(&self, other: &RustType) -> bool
source§impl RustType
impl RustType
sourcepub fn to_const_lit_string(&self) -> Cow<'static, str>
pub fn to_const_lit_string(&self) -> Cow<'static, str>
Returns the representation of this type in rust code in a const context.
Primitive (heapless) types remain unchanged, while types such as String
, Vec<u8>
, …
are replaced by their 'static
representatives (&'static str
, &'static [u8]
, …)
Trait Implementations§
source§impl PartialEq<RustType> for RustType
impl PartialEq<RustType> for RustType
source§impl PartialOrd<RustType> for RustType
impl PartialOrd<RustType> for RustType
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 ToProtobufType for RustType
impl ToProtobufType for RustType
fn to_protobuf(&self) -> ProtobufType
impl StructuralPartialEq for RustType
Auto Trait Implementations§
impl RefUnwindSafe for RustType
impl Send for RustType
impl Sync for RustType
impl Unpin for RustType
impl UnwindSafe for RustType
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