[][src]Struct netidx_protocols::archive::ArchiveReader

pub struct ArchiveReader { /* fields omitted */ }

Implementations

impl ArchiveReader[src]

pub fn open(path: impl AsRef<FilePath>) -> Result<Self>[src]

Open the specified archive read only. Note, it is possible to read and write to an archive simultaneously, however to do so you must open an ArchiveWriter and then use the ArchiveWriter::reader method to get a reader.

pub fn capacity(&self) -> usize[src]

pub fn delta_batches(&self) -> usize[src]

pub fn image_batches(&self) -> usize[src]

pub fn id_for_path(&self, path: &Path) -> Option<Id>[src]

pub fn path_for_id(&self, id: &Id) -> Option<Path>[src]

pub fn check_remap_rescan(&self) -> Result<()>[src]

Check if the memory map needs to be remapped due to growth, and check if additional records exist that need to be indexed. This method is only relevant if this ArchiveReader was created from an ArchiveWriter, this method is called automatically by read_deltas and build_image.

pub fn seek(&self, cursor: &mut Cursor, seek: Seek)[src]

Move the cursor according to the Seek instruction. If the cursor has no current position then positive offsets begin at the cursor start, and negative offsets begin at the cursor end. If the seek instruction would move the cursor out of bounds, then it will move to the closest in bounds position.

pub fn get_index(&self) -> Pooled<Vec<(Id, Path)>>[src]

Return a vector of all id/path pairs present in the archive. This may change if the archive is being written to.

pub fn build_image(&self, cursor: &Cursor) -> Result<Pooled<HashMap<Id, Event>>>[src]

Builds an image corresponding to the state at the cursor, or if the cursor has no current position then at the beginning of the cursor. If the cursor has no position and then beginning is Unbounded, then the image will be empty. If there are no images in the archive, then all the deltas between the beginning and the cursor position will be read, otherwise only the deltas between the closest image that is older, and the cursor start need to be read.

pub fn read_deltas(
    &self,
    cursor: &mut Cursor,
    n: usize
) -> Result<Pooled<VecDeque<(DateTime<Utc>, Pooled<Vec<BatchItem>>)>>>
[src]

read at most n delta items from the specified cursor, and advance it by the number of items read. The cursor will not be invalidated even if no items can be read, however depending on it's bounds it may never read any more items.

Trait Implementations

impl Clone for ArchiveReader[src]

impl Debug for ArchiveReader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,