pub struct FileBuilder<'a> { /* private fields */ }
Expand description
Constructs a UnixFS file.
Implementations§
Source§impl<'a> FileBuilder<'a>
FileBuilder separates uses a reader or bytes to chunk the data into raw unixfs nodes
impl<'a> FileBuilder<'a>
FileBuilder separates uses a reader or bytes to chunk the data into raw unixfs nodes
pub fn new() -> Self
pub fn chunker(self, chunker: impl Into<Chunker>) -> Self
Sourcepub fn fixed_chunker(self, chunk_size: usize) -> Self
pub fn fixed_chunker(self, chunk_size: usize) -> Self
Set the chunker to be fixed size.
Sourcepub fn rabin_chunker(self) -> Self
pub fn rabin_chunker(self) -> Self
Use the rabin chunker.
pub fn degree(self, degree: usize) -> Self
pub fn content_bytes(self, content: impl Into<Bytes>) -> Self
pub fn content_reader(self, content: impl AsyncRead + CondSend + 'a) -> Self
pub fn build(self) -> Result<File<'a>>
Trait Implementations§
Source§impl<'a> Debug for FileBuilder<'a>
impl<'a> Debug for FileBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for FileBuilder<'a>
impl<'a> !RefUnwindSafe for FileBuilder<'a>
impl<'a> Send for FileBuilder<'a>
impl<'a> !Sync for FileBuilder<'a>
impl<'a> Unpin for FileBuilder<'a>
impl<'a> !UnwindSafe for FileBuilder<'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