Struct lava_torrent::torrent::v1::File
[−]
[src]
pub struct File { pub length: Integer, pub path: PathBuf, pub extra_fields: Option<Dictionary>, }
A file contained in a torrent.
Modeled after the specifications
in BEP 3. Unknown/extension
fields will be placed in extra_fields
. If you need
any of those extra fields you would have to parse it yourself.
Fields
length: Integer
File size in bytes.
path: PathBuf
File path, relative to Torrent
's name
field.
extra_fields: Option<Dictionary>
Fields not defined in BEP 3.
Methods
impl File
[src]
pub fn absolute_path<P>(&self, parent: P) -> Result<PathBuf> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Construct the File
's absolute path using parent
.
Caller has to ensure that parent
is an absolute path.
Otherwise an error would be returned.
This method effectively appends/joins self.path
to parent
.
Trait Implementations
impl Clone for File
[src]
fn clone(&self) -> File
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for File
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for File
[src]
impl PartialEq for File
[src]
fn eq(&self, __arg_0: &File) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &File) -> bool
[src]
This method tests for !=
.