pub type VectorRef<'a> = VectorInner<&'a [VectorItemType]>;Aliased Type§
pub struct VectorRef<'a> {
pub(crate) inner: &'a [OrderedFloat<f32>],
}Fields§
§inner: &'a [OrderedFloat<f32>]Implementations§
Source§impl<'a> VectorRef<'a>
impl<'a> VectorRef<'a>
Sourcepub fn from_slice_unchecked(inner: &'a [VectorItemType]) -> Self
pub fn from_slice_unchecked(inner: &'a [VectorItemType]) -> Self
Create a VectorRef from a slice of VectorItemType without checking the elements in the slice
is invalid, such as inf and nan.
pub fn memcmp_serialize( self, serializer: &mut Serializer<impl BufMut>, ) -> Result<()>
pub fn subvector(&self, start: usize, end: usize) -> VectorVal
Trait Implementations§
Source§impl<'a> ScalarRef<'a> for VectorRef<'a>
impl<'a> ScalarRef<'a> for VectorRef<'a>
Source§type ScalarType = VectorInner<Box<[OrderedFloat<f32>]>>
type ScalarType = VectorInner<Box<[OrderedFloat<f32>]>>
ScalarType is the owned type of current ScalarRef.Source§fn to_owned_scalar(&self) -> VectorVal
fn to_owned_scalar(&self) -> VectorVal
Convert
ScalarRef to an owned scalar.Source§fn hash_scalar<H: Hasher>(&self, state: &mut H)
fn hash_scalar<H: Hasher>(&self, state: &mut H)
A wrapped hash function to get the hash value for this scaler.
Source§impl ToText for VectorRef<'_>
impl ToText for VectorRef<'_>
Source§fn write<W: Write>(&self, f: &mut W) -> Result
fn write<W: Write>(&self, f: &mut W) -> Result
Write the text to the writer regardless of its data type Read more
Source§fn write_with_type<W: Write>(&self, _ty: &DataType, f: &mut W) -> Result
fn write_with_type<W: Write>(&self, _ty: &DataType, f: &mut W) -> Result
Write the text to the writer according to its data type
Source§fn to_text_with_type(&self, ty: &DataType) -> String
fn to_text_with_type(&self, ty: &DataType) -> String
Convert to text according to its data type
Source§fn to_text(&self) -> String
fn to_text(&self) -> String
to_text is a special version of to_text_with_type, it convert the scalar to default type
text. E.g. for Int64, it will convert to text as a Int64 type.
We should prefer to use to_text_with_type because it’s more clear and readable. Read moreSource§fn text_display(&self) -> impl Display + '_
fn text_display(&self) -> impl Display + '_
Returns an displayable wrapper implemented with
ToText::write.Source§impl<'scalar> TryFrom<ScalarRefImpl<'scalar>> for VectorRef<'scalar>
impl<'scalar> TryFrom<ScalarRefImpl<'scalar>> for VectorRef<'scalar>
Source§type Error = ArrayError
type Error = ArrayError
The type returned in the event of a conversion error.
Source§fn try_from(val: ScalarRefImpl<'scalar>) -> ArrayResult<Self>
fn try_from(val: ScalarRefImpl<'scalar>) -> ArrayResult<Self>
Performs the conversion.