Struct raft_engine::internals::Writer
source · [−]pub struct Writer<P, O> { /* private fields */ }Expand description
Implementations
sourceimpl<P, O> Writer<P, O>
impl<P, O> Writer<P, O>
sourcepub fn new(payload: &mut P, sync: bool) -> Self
pub fn new(payload: &mut P, sync: bool) -> Self
Creates a new writer.
Safety
Data pointed by payload is mutably referenced by this writer. Do not
access the payload by its original name during this writer’s lifetime.
sourcepub fn mut_payload(&mut self) -> &mut P
pub fn mut_payload(&mut self) -> &mut P
Returns a mutable reference to the payload.
sourcepub fn set_output(&mut self, output: O)
pub fn set_output(&mut self, output: O)
Sets the output. This method is re-entrant.
sourcepub fn finish(self) -> O
pub fn finish(self) -> O
Consumes itself and yields an output.
Panics
Panics if called before being processed by a WriteBarrier or setting
the output itself.
Auto Trait Implementations
impl<P, O> !RefUnwindSafe for Writer<P, O>
impl<P, O> !Send for Writer<P, O>
impl<P, O> !Sync for Writer<P, O>
impl<P, O> Unpin for Writer<P, O>where
O: Unpin,
impl<P, O> !UnwindSafe for Writer<P, O>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more