pub enum MaybeOwnedComponentBatch<'a> {
Owned(Box<dyn ComponentBatch<Name = ComponentName>>),
Ref(&'a dyn ComponentBatch<Name = ComponentName>),
}
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<Name = ComponentName>>)
Ref(&'a dyn ComponentBatch<Name = ComponentName>)
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<Name = ComponentName> + 'a)
fn as_ref(&self) -> &(dyn ComponentBatch<Name = ComponentName> + '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<Name = ComponentName> + 'a)
fn deref(&self) -> &(dyn ComponentBatch<Name = ComponentName> + '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<Name = ComponentName>
) -> MaybeOwnedComponentBatch<'a>
fn from( comp_batch: &'a dyn ComponentBatch<Name = ComponentName> ) -> MaybeOwnedComponentBatch<'a>
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<Name = ComponentName>>
) -> MaybeOwnedComponentBatch<'_>
fn from( comp_batch: Box<dyn ComponentBatch<Name = ComponentName>> ) -> MaybeOwnedComponentBatch<'_>
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) -> <MaybeOwnedComponentBatch<'a> as LoggableBatch>::Name
fn name(&self) -> <MaybeOwnedComponentBatch<'a> as LoggableBatch>::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
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