pub struct EncData { /* private fields */ }
Expand description
EncData
is like Data
but the buffer contains transfer encoded data.
Clone
Data
is made to be cheap to clone and share.
For this it uses Arc
internally.
Implementations§
source§impl EncData
impl EncData
sourcepub fn transfer_encoded_buffer(&self) -> &Arc<[u8]>
pub fn transfer_encoded_buffer(&self) -> &Arc<[u8]>
Access the raw transfer encoded data.
sourcepub fn media_type(&self) -> &MediaType
pub fn media_type(&self) -> &MediaType
Access the content type.
sourcepub fn encoding(&self) -> TransferEncoding
pub fn encoding(&self) -> TransferEncoding
Access the transfer encoding used to encode the buffer.
sourcepub fn content_id(&self) -> &MessageId
pub fn content_id(&self) -> &MessageId
Access the content id.
The content id is for the data itself so it should not change just because the data had been transfer encoded.
Note about fixed newlines:
The encoding functions of this library will always “fix” line endings even if the transfer encoding is to not have any encoding, it could be said that this is a modification of the data and as such the content id should change. But as this is done always and as such only the transfer encoded data is “send” out this works out fine.
Trait Implementations§
source§impl<'de> Deserialize<'de> for EncData
impl<'de> Deserialize<'de> for EncData
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<EncData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<EncData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for EncData
impl Serialize for EncData
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more