pub struct Lace { /* private fields */ }Implementations§
Source§impl Lace
impl Lace
Sourcepub fn filesystem(path: impl AsRef<Path>) -> Result<Self>
pub fn filesystem(path: impl AsRef<Path>) -> Result<Self>
Exclusively open a filesystem root until close or final owner drop. Share Lace handles instead of opening the same root again.
Sourcepub fn portable(
path: impl AsRef<Path>,
format: PortableStoreFormat,
) -> Result<Self>
pub fn portable( path: impl AsRef<Path>, format: PortableStoreFormat, ) -> Result<Self>
Exclusively open a portable file store root until close or final
owner drop, creating it with format when the root is empty or
absent; an existing root keeps the format it was created with.
Share Lace handles instead of opening the same root again.
pub fn memory(records: impl IntoIterator<Item = Record>) -> Self
pub fn empty_memory() -> Self
Sourcepub fn memory_with_capacity(
records: impl IntoIterator<Item = Record>,
bytes: usize,
) -> Result<Self>
pub fn memory_with_capacity( records: impl IntoIterator<Item = Record>, bytes: usize, ) -> Result<Self>
A memory Lace holding at most bytes of canonical record bytes,
counted once per record, so a duplicate holds nothing; indexes are not
counted. Seeding records beyond it fails with LimitExceeded,
as does the operation whose admission would exceed it, before anything
is admitted; other operations continue. Close releases the held bytes;
a record a reader still holds stays readable on its own.
Sourcepub fn with_operand_cache(self, entries: usize) -> Self
pub fn with_operand_cache(self, entries: usize) -> Self
Hold at most entries received peer operands, most recently used
first (default OperandCache::DEFAULT_ENTRIES); 0 holds none, so
every peer operand crosses as a Blob.
pub fn handle(&self) -> LaceHandle
Sourcepub fn held_bytes(&self) -> Option<usize>
pub fn held_bytes(&self) -> Option<usize>
The bytes a memory Lace with a capacity holds now, counted as its
constructor describes; None for any other store or once closed. Reads
the store between its operations, so it is meant for memory stores.