[][src]Struct safe_core::nfs::Writer

pub struct Writer<C: Client + 'static> { /* fields omitted */ }

Writer is used to write contents to a File and especially in chunks if the file happens to be too large.

Implementations

impl<C: Sync + Client + 'static> Writer<C>[src]

pub async fn new<'_>(
    client: &'_ C,
    storage: SelfEncryptionStorage<C>,
    file: File,
    mode: Mode,
    encryption_key: Option<Key>
) -> Result<Writer<C>, NfsError>
[src]

Create new instance of Writer.

pub async fn write<'_, '_>(&'_ self, data: &'_ [u8]) -> Result<(), NfsError>[src]

Data of a file/blob can be written in smaller chunks.

pub async fn close(self) -> Result<File, NfsError>[src]

close() should be invoked only after all the data is completely written. The file/blob is saved only when close() is invoked. Returns the final File with the data_map stored on the network.

Auto Trait Implementations

impl<C> !RefUnwindSafe for Writer<C>

impl<C> Send for Writer<C>

impl<C> Sync for Writer<C>

impl<C> Unpin for Writer<C> where
    C: Unpin

impl<C> !UnwindSafe for Writer<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,