pub enum IntSliceFormat {
Java,
Epserde,
BitFieldVec,
Ascii,
Json,
}Expand description
How to store slices of integers.
Variants§
Java
Java-compatible format: a sequence of big-endian 64-bit integers; available only on 64-bit platforms.
Epserde
A sequence of usize serialized using ε-serde.
BitFieldVec
A BitFieldVec stored using ε-serde: it stores each element using
⌊log₂(max)⌋ + 1 bits, and 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 IntSliceFormat
impl IntSliceFormat
Sourcepub fn store(
&self,
path: impl AsRef<Path>,
data: &[usize],
max: Option<usize>,
) -> Result<()>
pub fn store( &self, path: impl AsRef<Path>, data: &[usize], max: Option<usize>, ) -> Result<()>
Stores a slice of usize in the specified path using the format
defined by self.
max is the maximum value of the slice. If it is not provided, it will
be computed from the data.
Sourcepub fn load(&self, path: impl AsRef<Path>) -> Result<IntSlice>
pub fn load(&self, path: impl AsRef<Path>) -> Result<IntSlice>
Loads integer values from the specified path using the format defined
by self, returning an IntSlice.
The ε-serde-based formats (Epserde, BitFieldVec) and the Java format use memory mapping; ASCII and JSON are fully loaded into memory.
Trait Implementations§
Source§impl Clone for IntSliceFormat
impl Clone for IntSliceFormat
impl Copy for IntSliceFormat
Source§impl Debug for IntSliceFormat
impl Debug for IntSliceFormat
Source§impl Default for IntSliceFormat
impl Default for IntSliceFormat
Source§impl ValueEnum for IntSliceFormat
impl ValueEnum for IntSliceFormat
Auto Trait Implementations§
impl Freeze for IntSliceFormat
impl RefUnwindSafe for IntSliceFormat
impl Send for IntSliceFormat
impl Sync for IntSliceFormat
impl Unpin for IntSliceFormat
impl UnsafeUnpin for IntSliceFormat
impl UnwindSafe for IntSliceFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> EitherFullOrEpsCopy<T> for Twhere
T: ?Sized,
impl<T> FullCopyConsistent<T> for Twhere
T: ?Sized,
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