pub struct BorrowedShreddingState<'a> {
value: Option<&'a BinaryViewArray>,
typed_value: Option<&'a ArrayRef>,
}
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 BinaryViewArray>
§typed_value: Option<&'a ArrayRef>
Implementations§
Source§impl<'a> BorrowedShreddingState<'a>
impl<'a> BorrowedShreddingState<'a>
Sourcepub fn new(
value: Option<&'a BinaryViewArray>,
typed_value: Option<&'a ArrayRef>,
) -> Self
pub fn new( value: Option<&'a BinaryViewArray>, typed_value: Option<&'a ArrayRef>, ) -> Self
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();
Sourcepub fn value_field(&self) -> Option<&'a BinaryViewArray>
pub fn value_field(&self) -> Option<&'a BinaryViewArray>
Return a reference to the value field, if present
Sourcepub fn typed_value_field(&self) -> Option<&'a ArrayRef>
pub fn typed_value_field(&self) -> Option<&'a ArrayRef>
Return a reference to the typed_value field, if present
Trait Implementations§
Source§impl<'a> Clone for BorrowedShreddingState<'a>
impl<'a> Clone for BorrowedShreddingState<'a>
Source§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 moreSource§impl<'a> Debug for BorrowedShreddingState<'a>
impl<'a> Debug for BorrowedShreddingState<'a>
Source§impl From<BorrowedShreddingState<'_>> for ShreddingState
impl From<BorrowedShreddingState<'_>> for ShreddingState
Source§fn from(state: BorrowedShreddingState<'_>) -> Self
fn from(state: BorrowedShreddingState<'_>) -> Self
Converts to this type from the input type.
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