pub struct LiteralData { /* private fields */ }
Expand description
Literal Data Packet https://www.rfc-editor.org/rfc/rfc9580.html#name-literal-data-packet-type-id
Implementations§
Source§impl LiteralData
impl LiteralData
Sourcepub fn from_str(file_name: impl Into<BString>, raw_data: &str) -> Self
pub fn from_str(file_name: impl Into<BString>, raw_data: &str) -> Self
Creates a literal data packet from the given string. Normalizes line endings.
Sourcepub fn from_bytes(file_name: &BStr, data: &[u8]) -> Self
pub fn from_bytes(file_name: &BStr, data: &[u8]) -> Self
Creates a literal data packet from the given bytes.
Sourcepub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
pub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
Parses a LiteralData
packet from the given slice.
pub fn is_binary(&self) -> bool
pub fn data(&self) -> &[u8] ⓘ
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Extracts data in to raw data
Trait Implementations§
Source§impl AsRef<[u8]> for LiteralData
impl AsRef<[u8]> for LiteralData
Source§impl Clone for LiteralData
impl Clone for LiteralData
Source§fn clone(&self) -> LiteralData
fn clone(&self) -> LiteralData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LiteralData
impl Debug for LiteralData
Source§impl From<LiteralData> for Packet
impl From<LiteralData> for Packet
Source§fn from(other: LiteralData) -> Packet
fn from(other: LiteralData) -> Packet
Converts to this type from the input type.
Source§impl PacketTrait for LiteralData
impl PacketTrait for LiteralData
Source§impl PartialEq for LiteralData
impl PartialEq for LiteralData
Source§impl Serialize for LiteralData
impl Serialize for LiteralData
Source§impl TryFrom<Packet> for LiteralData
impl TryFrom<Packet> for LiteralData
impl Eq for LiteralData
impl StructuralPartialEq for LiteralData
Auto Trait Implementations§
impl Freeze for LiteralData
impl RefUnwindSafe for LiteralData
impl Send for LiteralData
impl Sync for LiteralData
impl Unpin for LiteralData
impl UnwindSafe for LiteralData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)