Skip to main content

MemoryBackend

Struct MemoryBackend 

Source
pub struct MemoryBackend { /* private fields */ }
Expand description

Every script in memory: for tests, and for hosts whose scripts are configuration that is published again at every start.

Implementations§

Source§

impl MemoryBackend

Source

pub fn new() -> MemoryBackend

An empty backend.

Trait Implementations§

Source§

impl Backend for MemoryBackend

Source§

fn head(&self, name: &str) -> Result<Option<Head>>

The head of name, or None when no such script exists.
Source§

fn swap_head( &self, name: &str, expected: Option<&Head>, new: &Head, ) -> Result<()>

Replace the head of name with new, if it is still expected (None: if no head exists yet). Otherwise a typed Conflict: someone got there first.
Source§

fn put_version(&self, name: &str, version: &Version) -> Result<()>

Store a version under name. Idempotent: a version is its content.
Source§

fn version(&self, name: &str, digest: &str) -> Result<Option<Version>>

The version digest of name, or None. An implementation verifies the content against the digest and refuses a mismatch.
Source§

fn names(&self) -> Result<Vec<String>>

Every script name that has a head, sorted.
Source§

fn start_run(&self, name: &str, run: &Run) -> Result<u64>

Record a run that is starting, under a fresh id (the id field is ignored), and return the id.
Source§

fn finish_run(&self, name: &str, run: &Run) -> Result<()>

Replace the record of a run already started.
Source§

fn run(&self, name: &str, id: u64) -> Result<Option<Run>>

Run id of name, or None.
Source§

fn last_run(&self, name: &str) -> Result<Option<Run>>

The run of name with the highest id, or None.
Source§

impl Default for MemoryBackend

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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

Source§

fn vzip(self) -> V