pub struct V2File<'a> { /* private fields */ }Expand description
A validated v2 payload file entry.
Implementations§
Source§impl<'a> V2File<'a>
impl<'a> V2File<'a>
Sourcepub fn path_components(&self) -> &[&'a [u8]]
pub fn path_components(&self) -> &[&'a [u8]]
Returns raw torrent path components.
Sourcepub fn path_utf8(&self) -> Option<Vec<&'a str>>
pub fn path_utf8(&self) -> Option<Vec<&'a str>>
Returns UTF-8 path components when all components are valid UTF-8.
Sourcepub const fn pieces_root(&self) -> Option<&'a [u8; 32]>
pub const fn pieces_root(&self) -> Option<&'a [u8; 32]>
Returns the 32-byte pieces root for a non-empty file.
Sourcepub const fn attributes(&self) -> &'a [u8] ⓘ
pub const fn attributes(&self) -> &'a [u8] ⓘ
Returns file attribute bytes, including unknown attributes.
Sourcepub const fn piece_layer(&self) -> Option<&'a [u8]>
pub const fn piece_layer(&self) -> Option<&'a [u8]>
Returns the validated piece-layer bytes for files larger than one piece.
Sourcepub const fn properties(&self) -> &'a Value<'a>
pub const fn properties(&self) -> &'a Value<'a>
Returns the raw file properties dictionary for extension access.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for V2File<'a>
impl<'a> RefUnwindSafe for V2File<'a>
impl<'a> Send for V2File<'a>
impl<'a> Sync for V2File<'a>
impl<'a> Unpin for V2File<'a>
impl<'a> UnwindSafe for V2File<'a>
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