pub struct BinaryScalar<'a> { /* private fields */ }
Expand description
A scalar value representing binary data.
This type provides a view into a binary scalar value, which can be either a valid byte buffer or null.
Implementations§
Source§impl<'a> BinaryScalar<'a>
impl<'a> BinaryScalar<'a>
Sourcepub fn from_scalar_value(
dtype: &'a DType,
value: ScalarValue,
) -> VortexResult<Self>
pub fn from_scalar_value( dtype: &'a DType, value: ScalarValue, ) -> VortexResult<Self>
Creates a binary scalar from a data type and scalar value.
§Errors
Returns an error if the data type is not a binary type.
Sourcepub fn value(&self) -> Option<ByteBuffer>
pub fn value(&self) -> Option<ByteBuffer>
Returns the binary value as a byte buffer, or None if null.
Sourcepub fn value_ref(&self) -> Option<&ByteBuffer>
pub fn value_ref(&self) -> Option<&ByteBuffer>
Returns a reference to the binary value, or None if null. This avoids cloning the underlying ByteBuffer.
Sourcepub fn upper_bound(self, max_length: usize) -> Option<Self>
pub fn upper_bound(self, max_length: usize) -> Option<Self>
Constructs a value at most max_length
in size that’s greater than this value.
Returns None if constructing a greater value would overflow.
Sourcepub fn lower_bound(self, max_length: usize) -> Self
pub fn lower_bound(self, max_length: usize) -> Self
Construct a value at most max_length
in size that’s less than ourselves.
Trait Implementations§
Source§impl<'a> Debug for BinaryScalar<'a>
impl<'a> Debug for BinaryScalar<'a>
Source§impl Display for BinaryScalar<'_>
impl Display for BinaryScalar<'_>
Source§impl<'a> Hash for BinaryScalar<'a>
impl<'a> Hash for BinaryScalar<'a>
Source§impl Ord for BinaryScalar<'_>
impl Ord for BinaryScalar<'_>
Source§impl PartialEq for BinaryScalar<'_>
impl PartialEq for BinaryScalar<'_>
Source§impl PartialOrd for BinaryScalar<'_>
impl PartialOrd for BinaryScalar<'_>
Source§impl<'a> TryFrom<&'a Scalar> for BinaryScalar<'a>
impl<'a> TryFrom<&'a Scalar> for BinaryScalar<'a>
impl Eq for BinaryScalar<'_>
Auto Trait Implementations§
impl<'a> Freeze for BinaryScalar<'a>
impl<'a> RefUnwindSafe for BinaryScalar<'a>
impl<'a> Send for BinaryScalar<'a>
impl<'a> Sync for BinaryScalar<'a>
impl<'a> Unpin for BinaryScalar<'a>
impl<'a> UnwindSafe for BinaryScalar<'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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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