pub struct V1Metainfo<'a> { /* private fields */ }Expand description
Validated typed view of v1 metainfo.
Implementations§
Source§impl<'a> V1Metainfo<'a>
impl<'a> V1Metainfo<'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 v1 view from raw metainfo.
§Errors
Returns a metainfo error for missing or incorrectly typed fields, invalid paths or lengths, arithmetic overflow, or an inconsistent piece count.
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 total payload bytes.
Sourcepub const fn is_single_file(&self) -> bool
pub const fn is_single_file(&self) -> bool
Returns whether this uses the v1 single-file representation.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for V1Metainfo<'a>
impl<'a> RefUnwindSafe for V1Metainfo<'a>
impl<'a> Send for V1Metainfo<'a>
impl<'a> Sync for V1Metainfo<'a>
impl<'a> Unpin for V1Metainfo<'a>
impl<'a> UnwindSafe for V1Metainfo<'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