pub enum Value {
Nil,
Bool(bool),
Num(Num),
Bin(Box<[u8]>),
Str(Utf8Str),
Arr(Vec<Value>),
Map(Vec<(Value, Value)>),
Ext(i8, Box<[u8]>),
}
Expand description
MessagePack Rust owned Value type
Variants§
Nil
MessagePack Nil
type
Bool(bool)
MessagePack Boolean
type
Num(Num)
MessagePack Number
type
Bin(Box<[u8]>)
MessagePack Bin
type
Str(Utf8Str)
MessagePack Str
type
Arr(Vec<Value>)
MessagePack Arr
type
Map(Vec<(Value, Value)>)
MessagePack Map
type
Ext(i8, Box<[u8]>)
MessagePack Ext
type
Implementations§
Source§impl Value
impl Value
Sourcepub fn to_sync<'con, C>(&self, c: C) -> Result<()>where
C: Into<DynConsumerSync<'con>>,
pub fn to_sync<'con, C>(&self, c: C) -> Result<()>where
C: Into<DynConsumerSync<'con>>,
Encode this value as message pack data to the given consumer.
E.g. &mut Vec<u8>
Sourcepub fn to_sync_config<'con, C>(&self, c: C, config: &Config) -> Result<()>where
C: Into<DynConsumerSync<'con>>,
pub fn to_sync_config<'con, C>(&self, c: C, config: &Config) -> Result<()>where
C: Into<DynConsumerSync<'con>>,
Encode this value as message pack data to the given consumer.
E.g. &mut Vec<u8>
Sourcepub async fn to_async<'con, C>(&self, c: C) -> Result<()>where
C: Into<DynConsumerAsync<'con>>,
pub async fn to_async<'con, C>(&self, c: C) -> Result<()>where
C: Into<DynConsumerAsync<'con>>,
Encode this value as message pack data to the given consumer.
E.g. &mut Vec<u8>
Sourcepub async fn to_async_config<'con, C>(
&self,
c: C,
config: &Config,
) -> Result<()>where
C: Into<DynConsumerAsync<'con>>,
pub async fn to_async_config<'con, C>(
&self,
c: C,
config: &Config,
) -> Result<()>where
C: Into<DynConsumerAsync<'con>>,
Encode this value as message pack data to the given consumer.
E.g. &mut Vec<u8>
Sourcepub fn from_sync<'prod, P>(p: P) -> Result<Self>where
P: Into<DynProducerSync<'prod>>,
pub fn from_sync<'prod, P>(p: P) -> Result<Self>where
P: Into<DynProducerSync<'prod>>,
Decode a Value from something that can be converted
into a DynProducerSync, such as a byte array slice (&[u8]
)
Sourcepub fn from_sync_config<'prod, P>(p: P, config: &Config) -> Result<Self>where
P: Into<DynProducerSync<'prod>>,
pub fn from_sync_config<'prod, P>(p: P, config: &Config) -> Result<Self>where
P: Into<DynProducerSync<'prod>>,
Decode a Value from something that can be converted
into a DynProducerSync, such as a byte array slice (&[u8]
)
Sourcepub async fn from_async<'prod, P>(p: P) -> Result<Self>where
P: Into<DynProducerAsync<'prod>>,
pub async fn from_async<'prod, P>(p: P) -> Result<Self>where
P: Into<DynProducerAsync<'prod>>,
Decode a Value from something that can be converted
into a DynProducerAsync, such as a byte array slice (&[u8]
)
Sourcepub async fn from_async_config<'prod, P>(p: P, config: &Config) -> Result<Self>where
P: Into<DynProducerAsync<'prod>>,
pub async fn from_async_config<'prod, P>(p: P, config: &Config) -> Result<Self>where
P: Into<DynProducerAsync<'prod>>,
Decode a Value from something that can be converted
into a DynProducerAsync, such as a byte array slice (&[u8]
)