pub enum IntVectorFormat {
Java,
Epserde,
BitFieldVec,
Ascii,
Json,
}Expand description
How to store vectors of integers.
Variants§
Java
Java-compatible format: a sequence of big-endian longs (64 bits).
Epserde
A slice of usize serialized using ε-serde.
BitFieldVec
A BitFieldVec stored using ε-serde. It stores each element using
⌊log₂(max)⌋ + 1 bits. It requires to allocate the BitFieldVec in RAM
before serializing it.
Ascii
ASCII format, one integer per line.
Json
A JSON Array.
Implementations§
Source§impl IntVectorFormat
impl IntVectorFormat
Sourcepub fn store(
&self,
path: impl AsRef<Path>,
data: &[u64],
max: Option<u64>,
) -> Result<()>
pub fn store( &self, path: impl AsRef<Path>, data: &[u64], max: Option<u64>, ) -> Result<()>
Stores a vector of u64 in the specified path`` using the format defined by self`.
max is the maximum value of the vector. If it is not provided, it will
be computed from the data.
Sourcepub fn store_usizes(
&self,
path: impl AsRef<Path>,
data: &[usize],
max: Option<usize>,
) -> Result<()>
pub fn store_usizes( &self, path: impl AsRef<Path>, data: &[usize], max: Option<usize>, ) -> Result<()>
Stores a vector of usize in the specified path using the format defined by self.
max is the maximum value of the vector, if it is not provided, it will
be computed from the data.
This helper method is available only on 64-bit architectures as Java’s format uses of 64-bit integers.
Trait Implementations§
Source§impl Clone for IntVectorFormat
impl Clone for IntVectorFormat
Source§fn clone(&self) -> IntVectorFormat
fn clone(&self) -> IntVectorFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntVectorFormat
impl Debug for IntVectorFormat
Source§impl ValueEnum for IntVectorFormat
impl ValueEnum for IntVectorFormat
impl Copy for IntVectorFormat
Auto Trait Implementations§
impl Freeze for IntVectorFormat
impl RefUnwindSafe for IntVectorFormat
impl Send for IntVectorFormat
impl Sync for IntVectorFormat
impl Unpin for IntVectorFormat
impl UnwindSafe for IntVectorFormat
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
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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>
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>
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