Skip to main content

JournalEntry

Struct JournalEntry 

#[non_exhaustive]
pub struct JournalEntry { pub seq: u64, pub kind: String, pub cause: Option<u64>, pub origin: Option<Origin>, pub input: Option<Arc<dyn Any + Sync + Send>>, pub text: Option<String>, }
Expand description

One event of a journal: what happened, its number, what caused it.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§seq: u64

Its number in this journal: from 1, increasing by one, never reused while the process runs.

§kind: String

Its kind: the event point’s id, or a kind the journal keeps with no point (a fact recorded by the implementation, an event relayed from a process whose point this one does not declare).

§cause: Option<u64>

The entry that caused it, if one did: a number in this journal, or, for an entry relayed in (JournalEntry::origin set), in its origin’s.

§origin: Option<Origin>

Where it was published: None here, else the origin the crossing contract’s Relay::ingest was given (another process, an agent’s session). Every entry taken in has one.

§input: Option<Arc<dyn Any + Sync + Send>>

Its input, typed, when this process holds it: published here, or relayed and decoded with its point’s codec.

§text: Option<String>

Its input as text, when it has one: relayed in, or written by a codec.

Implementations§

§

impl JournalEntry

pub fn new(seq: u64, kind: impl Into<String>) -> JournalEntry

The entry seq of kind, with no cause, no origin and no input.

pub fn read<P>(&self) -> Option<&<P as Point>::Input>
where P: Point,

The input of the event point P, when the entry is one of its events and holds it typed.

Trait Implementations§

§

impl Clone for JournalEntry

§

fn clone(&self) -> JournalEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for JournalEntry

§

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

Formats the value using the given formatter. 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<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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.