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
) -> 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 ) -> 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.