pub struct V2Metainfo<'a> { /* private fields */ }Expand description
Validated typed view of v2 or hybrid metainfo.
Implementations§
Source§impl<'a> V2Metainfo<'a>
impl<'a> V2Metainfo<'a>
Sourcepub fn from_raw(raw: &'a RawMetainfo<'a>) -> Result<Self>
pub fn from_raw(raw: &'a RawMetainfo<'a>) -> Result<Self>
Validates and constructs a typed v2 or hybrid view.
§Errors
Returns a metainfo error for malformed trees, invalid roots or layers, unsupported meta versions, or inconsistent hybrid representations.
Sourcepub const fn mode(&self) -> TorrentMode
pub const fn mode(&self) -> TorrentMode
Returns the validated torrent mode.
Sourcepub const fn piece_length(&self) -> u64
pub const fn piece_length(&self) -> u64
Returns the piece length in bytes.
Sourcepub const fn total_length(&self) -> u64
pub const fn total_length(&self) -> u64
Returns the checked aggregate payload length.
Sourcepub const fn piece_count(&self) -> u64
pub const fn piece_count(&self) -> u64
Returns the checked aggregate number of file pieces.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for V2Metainfo<'a>
impl<'a> RefUnwindSafe for V2Metainfo<'a>
impl<'a> Send for V2Metainfo<'a>
impl<'a> Sync for V2Metainfo<'a>
impl<'a> Unpin for V2Metainfo<'a>
impl<'a> UnwindSafe for V2Metainfo<'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