Skip to main content

Op

Enum Op 

Source
pub enum Op {
    Open {
        path: PathBuf,
        mode: OpenMode,
    },
    Write {
        path: PathBuf,
        offset: u64,
        len: usize,
    },
    Sync {
        path: PathBuf,
    },
    Truncate {
        path: PathBuf,
        len: u64,
    },
    Rename {
        from: PathBuf,
        to: PathBuf,
    },
    Remove {
        path: PathBuf,
    },
    CreateDir {
        path: PathBuf,
    },
    SyncDir {
        path: PathBuf,
    },
}
Expand description

One recorded operation.

Writes record their length rather than their bytes, because a log of a ClickBench load with the payloads in it is a log nobody can read and a test nobody can debug.

Variants§

§

Open

A file was opened.

Fields

§path: PathBuf

The file.

§mode: OpenMode

How it was opened.

§

Write

Bytes were written.

Fields

§path: PathBuf

The file.

§offset: u64

Where they went.

§len: usize

How many.

§

Sync

A file was made durable.

Fields

§path: PathBuf

The file.

§

Truncate

A file was cut or extended.

Fields

§path: PathBuf

The file.

§len: u64

The new length.

§

Rename

A file was moved.

Fields

§from: PathBuf

Where it was.

§to: PathBuf

Where it went.

§

Remove

A file was deleted.

Fields

§path: PathBuf

The file.

§

CreateDir

A directory was created.

Fields

§path: PathBuf

The directory.

§

SyncDir

A directory entry was made durable.

Fields

§path: PathBuf

The directory.

Implementations§

Source§

impl Op

Source

pub fn is_durability_point(&self) -> bool

Whether this operation is one that makes earlier work durable.

The failure point enumeration in section 16.5 cares about these, because the interval between two of them is the window in which writes can be reordered against each other.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Op

Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.