Struct BorrowedShreddingState
pub struct BorrowedShreddingState<'a> {
value: Option<&'a GenericByteViewArray<BinaryViewType>>,
typed_value: Option<&'a Arc<dyn Array>>,
}
Expand description
Similar to ShreddingState
except it holds borrowed references of the target arrays. Useful
for avoiding clone operations when the caller does not need a self-standing shredding state.
Fields§
§value: Option<&'a GenericByteViewArray<BinaryViewType>>
§typed_value: Option<&'a Arc<dyn Array>>
Implementations§
§impl<'a> BorrowedShreddingState<'a>
impl<'a> BorrowedShreddingState<'a>
pub fn new(
value: Option<&'a GenericByteViewArray<BinaryViewType>>,
typed_value: Option<&'a Arc<dyn Array>>,
) -> BorrowedShreddingState<'a>
pub fn new( value: Option<&'a GenericByteViewArray<BinaryViewType>>, typed_value: Option<&'a Arc<dyn Array>>, ) -> BorrowedShreddingState<'a>
Create a new BorrowedShreddingState
from the given value
and typed_value
fields
Note you can create a BorrowedShreddingState
from a &[StructArray
] using
BorrowedShreddingState::try_from(&struct_array)
, for example:
let struct_array: StructArray = get_struct_array();
let shredding_state = BorrowedShreddingState::try_from(&struct_array).unwrap();
pub fn value_field(&self) -> Option<&'a GenericByteViewArray<BinaryViewType>>
pub fn value_field(&self) -> Option<&'a GenericByteViewArray<BinaryViewType>>
Return a reference to the value field, if present
pub fn typed_value_field(&self) -> Option<&'a Arc<dyn Array>>
pub fn typed_value_field(&self) -> Option<&'a Arc<dyn Array>>
Return a reference to the typed_value field, if present
Trait Implementations§
§impl<'a> Clone for BorrowedShreddingState<'a>
impl<'a> Clone for BorrowedShreddingState<'a>
§fn clone(&self) -> BorrowedShreddingState<'a>
fn clone(&self) -> BorrowedShreddingState<'a>
Returns a duplicate 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 more§impl<'a> Debug for BorrowedShreddingState<'a>
impl<'a> Debug for BorrowedShreddingState<'a>
§impl From<BorrowedShreddingState<'_>> for ShreddingState
impl From<BorrowedShreddingState<'_>> for ShreddingState
§fn from(state: BorrowedShreddingState<'_>) -> ShreddingState
fn from(state: BorrowedShreddingState<'_>) -> ShreddingState
Converts to this type from the input type.
§impl<'a> TryFrom<&'a StructArray> for BorrowedShreddingState<'a>
impl<'a> TryFrom<&'a StructArray> for BorrowedShreddingState<'a>
Auto Trait Implementations§
impl<'a> Freeze for BorrowedShreddingState<'a>
impl<'a> !RefUnwindSafe for BorrowedShreddingState<'a>
impl<'a> Send for BorrowedShreddingState<'a>
impl<'a> Sync for BorrowedShreddingState<'a>
impl<'a> Unpin for BorrowedShreddingState<'a>
impl<'a> !UnwindSafe for BorrowedShreddingState<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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