Type Alias someday::CommitRef

source ·
pub type CommitRef<T> = Arc<Commit<T>>;
Expand description

Cheaply cloneable snapshot of some data T and its Timestamp

This is a Commit of data received from operations like Writer::head() and Reader::head().

It is shared data, and cheaply Clone-able.

This is just an alias for Arc<Commit<T>>.

Aliased Type§

struct CommitRef<T> { /* private fields */ }

Trait Implementations§

source§

impl<T: Clone> From<&Reader<T>> for CommitRef<T>

source§

fn from(reader: &Reader<T>) -> Self

Calls Reader::head.

let (r, _) = someday::new(String::from("hello"));

let commit_ref: CommitRef<String> = (&r).into();
assert_eq!(commit_ref.data, "hello");