Struct reth_nippy_jar::NippyJar
source · 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 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.