Enum loro_internal::handler::ValueOrContainer
source · pub enum ValueOrContainer {
Value(LoroValue),
Container(Handler),
}
Variants§
Implementations§
source§impl ValueOrContainer
impl ValueOrContainer
sourcepub fn as_value_mut(&mut self) -> Option<&mut LoroValue>
pub fn as_value_mut(&mut self) -> Option<&mut LoroValue>
Optionally returns mutable references to the inner fields if this is a ValueOrContainer::Value
, otherwise None
sourcepub fn as_value(&self) -> Option<&LoroValue>
pub fn as_value(&self) -> Option<&LoroValue>
Optionally returns references to the inner fields if this is a ValueOrContainer::Value
, otherwise None
sourcepub fn into_value(self) -> Result<LoroValue, Self>
pub fn into_value(self) -> Result<LoroValue, Self>
Returns the inner fields if this is a ValueOrContainer::Value
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_container_mut(&mut self) -> Option<&mut Handler>
pub fn as_container_mut(&mut self) -> Option<&mut Handler>
Optionally returns mutable references to the inner fields if this is a ValueOrContainer::Container
, otherwise None
sourcepub fn as_container(&self) -> Option<&Handler>
pub fn as_container(&self) -> Option<&Handler>
Optionally returns references to the inner fields if this is a ValueOrContainer::Container
, otherwise None
sourcepub fn into_container(self) -> Result<Handler, Self>
pub fn into_container(self) -> Result<Handler, Self>
Returns the inner fields if this is a ValueOrContainer::Container
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl Clone for ValueOrContainer
impl Clone for ValueOrContainer
source§fn clone(&self) -> ValueOrContainer
fn clone(&self) -> ValueOrContainer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ValueOrContainer
impl Send for ValueOrContainer
impl Sync for ValueOrContainer
impl Unpin for ValueOrContainer
impl UnwindSafe for ValueOrContainer
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