Trait bip_metainfo::Accessor
[−]
[src]
pub trait Accessor { fn access_directory(&self) -> Option<&str>; fn access_metadata<C>(&self, callback: C) -> Result<()> where C: FnMut(u64, &Path); fn access_pieces<C>(&self, callback: C) -> Result<()> where C: FnMut(&mut Read) -> Result<()>; }
Trait for accessing the data used to construct a torrent file.
Required Methods
fn access_directory(&self) -> Option<&str>
Access the directory that all files should be relative to.
fn access_metadata<C>(&self, callback: C) -> Result<()> where C: FnMut(u64, &Path)
Access the metadata for all files including their length and path.
fn access_pieces<C>(&self, callback: C) -> Result<()> where C: FnMut(&mut Read) -> Result<()>
Access the sequential pieces that make up all of the files.
Implementors
impl<'a, T> Accessor for &'a T where T: Accessor
impl Accessor for FileAccessor
impl<'a> Accessor for DirectAccessor<'a>