Struct rust_ipfs::unixfs::IpfsUnixfs
source · pub struct IpfsUnixfs { /* private fields */ }
Implementations§
source§impl IpfsUnixfs
impl IpfsUnixfs
pub fn new(ipfs: Ipfs) -> Self
sourcepub async fn cat<'a>(
&self,
starting_point: impl Into<StartingPoint>,
range: Option<Range<u64>>,
peers: &'a [PeerId],
local: bool,
timeout: Option<Duration>
) -> Result<impl Stream<Item = Result<Vec<u8>, TraversalFailed>> + Send + 'a, TraversalFailed>
pub async fn cat<'a>( &self, starting_point: impl Into<StartingPoint>, range: Option<Range<u64>>, peers: &'a [PeerId], local: bool, timeout: Option<Duration> ) -> Result<impl Stream<Item = Result<Vec<u8>, TraversalFailed>> + Send + 'a, TraversalFailed>
Creates a stream which will yield the bytes of an UnixFS file from the root Cid, with the optional file byte range. If the range is specified and is outside of the file, the stream will end without producing any bytes.
To create an owned version of the stream, please use ipfs::unixfs::cat
directly.
sourcepub async fn add<'a, I: Into<AddOpt<'a>>>(
&self,
item: I,
option: Option<AddOption>
) -> Result<BoxStream<'a, UnixfsStatus>, Error>
pub async fn add<'a, I: Into<AddOpt<'a>>>( &self, item: I, option: Option<AddOption> ) -> Result<BoxStream<'a, UnixfsStatus>, Error>
Add a file from either a file or stream
To create an owned version of the stream, please use ipfs::unixfs::add
or ipfs::unixfs::add_file
directly.
sourcepub async fn get<'a, P: AsRef<Path>>(
&self,
path: IpfsPath,
dest: P,
peers: &'a [PeerId],
local: bool,
timeout: Option<Duration>
) -> Result<BoxStream<'a, UnixfsStatus>, Error>
pub async fn get<'a, P: AsRef<Path>>( &self, path: IpfsPath, dest: P, peers: &'a [PeerId], local: bool, timeout: Option<Duration> ) -> Result<BoxStream<'a, UnixfsStatus>, Error>
Retreive a file and saving it to a local path.
To create an owned version of the stream, please use ipfs::unixfs::get
directly.
Auto Trait Implementations§
impl !RefUnwindSafe for IpfsUnixfs
impl Send for IpfsUnixfs
impl Sync for IpfsUnixfs
impl Unpin for IpfsUnixfs
impl !UnwindSafe for IpfsUnixfs
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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