Skip to main content

MemoryWrite

Struct MemoryWrite 

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

What a session is handing to memory in one go.

Entries and their reasons travel together because they are one thought. A write that landed the entries and lost the edges would leave memory that reads correctly and cannot be followed, which is the failure that looks least like a failure.

Implementations§

Source§

impl MemoryWrite

Source

pub fn new( entries: Vec<MemoryEntry>, relations: Vec<MemoryRelation>, ) -> Result<Self, DomainError>

Entries, and the reasons connecting them.

A write carrying neither is refused here rather than by each backend in turn: it is a call that would change nothing, and a backend answering “remembered” to it would be lying quietly. Refusing at construction means no backend is ever handed one.

Relations may point outside this write. An ending explains a decision taken an hour ago, and whether that decision is still there is the backend’s to say, not this type’s — it cannot see what memory already holds.

Source

pub fn reasons_only(relations: Vec<MemoryRelation>) -> Result<Self, DomainError>

Reasons about things already remembered.

The shape a caller needs when the understanding arrives after the events: both ends were written earlier, and what is new is the edge between them. Whether those ends are still there is the backend’s to judge, not this type’s.

Source

pub fn unexplained(entries: Vec<MemoryEntry>) -> Result<Self, DomainError>

Entries with nothing yet connecting them.

Honest for a first entry, which has nothing earlier to explain it. Reached for habitually, it is how a memory ends up being a list.

Source

pub fn entries(&self) -> &[MemoryEntry]

Source

pub fn relations(&self) -> &[MemoryRelation]

Source

pub fn into_parts(self) -> (Vec<MemoryEntry>, Vec<MemoryRelation>)

Trait Implementations§

Source§

impl Clone for MemoryWrite

Source§

fn clone(&self) -> MemoryWrite

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 MemoryWrite

Source§

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

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

impl Eq for MemoryWrite

Source§

impl PartialEq for MemoryWrite

Source§

fn eq(&self, other: &MemoryWrite) -> 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 MemoryWrite

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> 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> Same for T

Source§

type Output = T

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