pub struct SemiShared<T>{ /* private fields */ }
Expand description
A semi shared allows for one instance of RW access, and many access of Read
Implementations§
Sourcepub fn new(value: T) -> SemiShared<T>
pub fn new(value: T) -> SemiShared<T>
Create a new semi shared value
Sourcepub fn writer(&self) -> Option<SemiSharedWriter<T>>
pub fn writer(&self) -> Option<SemiSharedWriter<T>>
Get the writer to this semi shared. Only on semi shared can exist at a time
Sourcepub fn reader(&self) -> SemiSharedReader<T>
pub fn reader(&self) -> SemiSharedReader<T>
Gets a reader to this semi shared. Any number of semi shared can exist at a time
Trait Implementations§
Auto Trait Implementations§
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
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more