pub struct NippyJar<H = ()> { /* private fields */ }
Expand description
NippyJar
is a specialized storage format designed for immutable data.
Data is organized into a columnar format, enabling column-based compression. Data retrieval
entails consulting an offset list and fetching the data from file via mmap
.
Implementations§
Source§impl NippyJar<()>
impl NippyJar<()>
Sourcepub fn new_without_header(columns: usize, path: &Path) -> Self
pub fn new_without_header(columns: usize, path: &Path) -> Self
Creates a new NippyJar
without an user-defined header data.
Sourcepub fn load_without_header(path: &Path) -> Result<Self, NippyJarError>
pub fn load_without_header(path: &Path) -> Result<Self, NippyJarError>
Loads the file configuration and returns Self
on a jar without user-defined header data.
Source§impl<H: NippyJarHeader> NippyJar<H>
impl<H: NippyJarHeader> NippyJar<H>
Sourcepub fn new(columns: usize, path: &Path, user_header: H) -> Self
pub fn new(columns: usize, path: &Path, user_header: H) -> Self
Creates a new NippyJar
with a user-defined header data.
Sourcepub fn with_zstd(self, use_dict: bool, max_dict_size: usize) -> Self
pub fn with_zstd(self, use_dict: bool, max_dict_size: usize) -> Self
Adds compression::Zstd
compression.
Sourcepub fn with_lz4(self) -> Self
pub fn with_lz4(self) -> Self
Adds compression::Lz4
compression.
Sourcepub const fn user_header(&self) -> &H
pub const fn user_header(&self) -> &H
Gets a reference to the user header.
Sourcepub const fn compressor(&self) -> Option<&Compressors>
pub const fn compressor(&self) -> Option<&Compressors>
Gets a reference to the compressor.
Sourcepub fn compressor_mut(&mut self) -> Option<&mut Compressors>
pub fn compressor_mut(&mut self) -> Option<&mut Compressors>
Gets a mutable reference to the compressor.
Sourcepub fn load(path: &Path) -> Result<Self, NippyJarError>
pub fn load(path: &Path) -> Result<Self, NippyJarError>
Loads the file configuration and returns Self
.
The user must ensure the header type matches the one used during the jar’s creation.
Sourcepub fn load_from_reader<R: Read>(reader: R) -> Result<Self, NippyJarError>
pub fn load_from_reader<R: Read>(reader: R) -> Result<Self, NippyJarError>
Sourcepub fn index_path(&self) -> PathBuf
pub fn index_path(&self) -> PathBuf
Returns the path for the index file
Sourcepub fn offsets_path(&self) -> PathBuf
pub fn offsets_path(&self) -> PathBuf
Returns the path for the offsets file
Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
Returns the path for the config file
Sourcepub fn delete(self) -> Result<(), NippyJarError>
pub fn delete(self) -> Result<(), NippyJarError>
Deletes from disk this NippyJar
alongside every satellite file.
Sourcepub fn open_data_reader(&self) -> Result<DataReader, NippyJarError>
pub fn open_data_reader(&self) -> Result<DataReader, NippyJarError>
Returns a DataReader
of the data and offset file
Trait Implementations§
Source§impl<H: NippyJarHeader> Debug for NippyJar<H>
impl<H: NippyJarHeader> Debug for NippyJar<H>
Source§impl<'de, H> Deserialize<'de> for NippyJar<H>where
H: Deserialize<'de>,
impl<'de, H> Deserialize<'de> for NippyJar<H>where
H: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<H> Freeze for NippyJar<H>where
H: Freeze,
impl<H> RefUnwindSafe for NippyJar<H>where
H: RefUnwindSafe,
impl<H> Send for NippyJar<H>where
H: Send,
impl<H> Sync for NippyJar<H>where
H: Sync,
impl<H> Unpin for NippyJar<H>where
H: Unpin,
impl<H> UnwindSafe for NippyJar<H>where
H: UnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> NippyJarHeader for T
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.