Enum objc2_encode::EncodingBox
source · #[non_exhaustive]pub enum EncodingBox {
Show 31 variants
Char,
Short,
Int,
Long,
LongLong,
UChar,
UShort,
UInt,
ULong,
ULongLong,
Float,
Double,
LongDouble,
FloatComplex,
DoubleComplex,
LongDoubleComplex,
Bool,
Void,
String,
Object,
Block,
Class,
Sel,
Unknown,
BitField(u8, Option<Box<(u64, Self)>>),
Pointer(Box<Self>),
Atomic(Box<Self>),
Array(u64, Box<Self>),
Struct(String, Vec<Self>),
Union(String, Vec<Self>),
None,
}
Expand description
The boxed version of Encoding
.
This has exactly the same items as Encoding
, the only difference is in
where the contents of the more complex encodings like Struct
are
stored.
In Encoding
, the data is stored in static memory, while in EncodingBox
it is stored on the heap. The former allows storing in constants (which is
required by the objc2::encode::Encode
and objc2::encode::RefEncode
traits), while the latter allows dynamic creation, such as in the case of
parsing encodings.
This should be considered a temporary restriction. Encoding
and
EncodingBox
will become equivalent once heap allocation in constants
is possible.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Char
Same as Encoding::Char
.
Short
Same as Encoding::Short
.
Int
Same as Encoding::Int
.
Long
Same as Encoding::Long
.
LongLong
Same as Encoding::LongLong
.
UChar
Same as Encoding::UChar
.
UShort
Same as Encoding::UShort
.
UInt
Same as Encoding::UInt
.
ULong
Same as Encoding::ULong
.
ULongLong
Same as Encoding::ULongLong
.
Float
Same as Encoding::Float
.
Double
Same as Encoding::Double
.
LongDouble
Same as Encoding::LongDouble
.
FloatComplex
Same as Encoding::FloatComplex
.
DoubleComplex
Same as Encoding::DoubleComplex
.
LongDoubleComplex
Same as Encoding::LongDoubleComplex
.
Bool
Same as Encoding::Bool
.
Void
Same as Encoding::Void
.
String
Same as Encoding::String
.
Object
Same as Encoding::Object
.
Block
Same as Encoding::Block
.
Class
Same as Encoding::Class
.
Sel
Same as Encoding::Sel
.
Unknown
Same as Encoding::Unknown
.
BitField(u8, Option<Box<(u64, Self)>>)
Same as Encoding::BitField
.
Pointer(Box<Self>)
Same as Encoding::Pointer
.
Atomic(Box<Self>)
Same as Encoding::Atomic
.
Array(u64, Box<Self>)
Same as Encoding::Array
.
Struct(String, Vec<Self>)
Same as Encoding::Struct
.
Union(String, Vec<Self>)
Same as Encoding::Union
.
None
Same as Encoding::None
.
Implementations§
source§impl EncodingBox
impl EncodingBox
sourcepub const C_LONG: Self = _
pub const C_LONG: Self = _
Same as Encoding::C_LONG
.
sourcepub const C_ULONG: Self = _
pub const C_ULONG: Self = _
Same as Encoding::C_ULONG
.
sourcepub fn from_start_of_str(s: &mut &str) -> Result<Self, ParseError>
pub fn from_start_of_str(s: &mut &str) -> Result<Self, ParseError>
Trait Implementations§
source§impl Clone for EncodingBox
impl Clone for EncodingBox
source§fn clone(&self) -> EncodingBox
fn clone(&self) -> EncodingBox
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EncodingBox
impl Debug for EncodingBox
source§impl Display for EncodingBox
impl Display for EncodingBox
Same formatting as Encoding
’s Display
implementation.
source§impl FromStr for EncodingBox
impl FromStr for EncodingBox
source§impl Hash for EncodingBox
impl Hash for EncodingBox
source§impl PartialEq<Encoding> for EncodingBox
impl PartialEq<Encoding> for EncodingBox
source§impl PartialEq<EncodingBox> for Encoding
impl PartialEq<EncodingBox> for Encoding
source§fn eq(&self, other: &EncodingBox) -> bool
fn eq(&self, other: &EncodingBox) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for EncodingBox
impl PartialEq for EncodingBox
source§fn eq(&self, other: &EncodingBox) -> bool
fn eq(&self, other: &EncodingBox) -> bool
self
and other
values to be equal, and is used
by ==
.