pub enum MaybeOwnedComponentBatch<'a> {
Owned(Box<dyn ComponentBatch>),
Ref(&'a dyn ComponentBatch),
}
Expand description
Holds either an owned ComponentBatch
that lives on heap, or a reference to one.
This doesn’t use std::borrow::Cow
on purpose: Cow
requires Clone
, which would break
object-safety, which would prevent us from erasing ComponentBatch
s in the first place.
Variants§
Owned(Box<dyn ComponentBatch>)
Ref(&'a dyn ComponentBatch)
Trait Implementations§
source§impl<'a> AsRef<dyn ComponentBatch<Name = ComponentName> + 'a> for MaybeOwnedComponentBatch<'a>
impl<'a> AsRef<dyn ComponentBatch<Name = ComponentName> + 'a> for MaybeOwnedComponentBatch<'a>
source§fn as_ref(&self) -> &(dyn ComponentBatch + 'a)
fn as_ref(&self) -> &(dyn ComponentBatch + 'a)
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'a> Deref for MaybeOwnedComponentBatch<'a>
impl<'a> Deref for MaybeOwnedComponentBatch<'a>
§type Target = dyn ComponentBatch<Name = ComponentName> + 'a
type Target = dyn ComponentBatch<Name = ComponentName> + 'a
The resulting type after dereferencing.
source§fn deref(&self) -> &(dyn ComponentBatch + 'a)
fn deref(&self) -> &(dyn ComponentBatch + 'a)
Dereferences the value.
source§impl<'a> From<&'a dyn ComponentBatch<Name = ComponentName>> for MaybeOwnedComponentBatch<'a>
impl<'a> From<&'a dyn ComponentBatch<Name = ComponentName>> for MaybeOwnedComponentBatch<'a>
source§fn from(comp_batch: &'a dyn ComponentBatch) -> Self
fn from(comp_batch: &'a dyn ComponentBatch) -> Self
Converts to this type from the input type.
source§impl From<Box<dyn ComponentBatch<Name = ComponentName>>> for MaybeOwnedComponentBatch<'_>
impl From<Box<dyn ComponentBatch<Name = ComponentName>>> for MaybeOwnedComponentBatch<'_>
source§fn from(comp_batch: Box<dyn ComponentBatch>) -> Self
fn from(comp_batch: Box<dyn ComponentBatch>) -> Self
Converts to this type from the input type.
source§impl<'a> LoggableBatch for MaybeOwnedComponentBatch<'a>
impl<'a> LoggableBatch for MaybeOwnedComponentBatch<'a>
type Name = ComponentName
source§fn name(&self) -> Self::Name
fn name(&self) -> Self::Name
The fully-qualified name of this batch, e.g.
rerun.datatypes.Vec2D
.source§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
The number of component instances stored into this batch.
source§fn arrow_field(&self) -> Field
fn arrow_field(&self) -> Field
The underlying
arrow2::datatypes::Field
, including datatype extensions.impl<'a> ComponentBatch for MaybeOwnedComponentBatch<'a>
Auto Trait Implementations§
impl<'a> Freeze for MaybeOwnedComponentBatch<'a>
impl<'a> !RefUnwindSafe for MaybeOwnedComponentBatch<'a>
impl<'a> !Send for MaybeOwnedComponentBatch<'a>
impl<'a> !Sync for MaybeOwnedComponentBatch<'a>
impl<'a> Unpin for MaybeOwnedComponentBatch<'a>
impl<'a> !UnwindSafe for MaybeOwnedComponentBatch<'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