Skip to main content

Segment

Struct Segment 

Source
pub struct Segment {
    pub meta: SegmentMeta,
    pub data: MmapPostingData,
    /* private fields */
}
Expand description

An open segment: its manifest entry and its mapping.

Fields§

§meta: SegmentMeta§data: MmapPostingData

Implementations§

Source§

impl Segment

Source

pub fn open(base: &Path, meta: SegmentMeta) -> Result<Self, String>

Source

pub fn is_live(&self, id: u64) -> bool

Whether this segment still answers for id.

Source

pub fn ids(&self) -> Result<&[u64], String>

The segment’s ids, loaded on first use.

Source

pub fn holds(&self, id: u64) -> Result<bool, String>

Whether this segment was written with id (deleted or not).

Source

pub fn tombstone(&mut self, id: u64) -> bool

Mark id deleted here. Answers whether it changed anything.

Source

pub fn path(&self) -> PathBuf

Source

pub fn ids_path(&self) -> PathBuf

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.