#[non_exhaustive]pub struct Branch {
pub id: BranchId,
pub parent: Option<BranchId>,
pub forked_at: Option<String>,
pub created_at: String,
}Expand description
One row of branches: a lineage, its parent, and where it was cut.
§#[non_exhaustive] costs nothing here, and that is a fact about direction
EdgeBelief needed a constructor to go with
the attribute, because save_snapshot is public and takes one — without
EdgeBelief::new the attribute would not have made the next field additive,
it would have made a public function uncallable (0.14.5). This type only
ever travels outward: Database::branches
returns it and nothing public accepts it. So the attribute buys the additive
field and takes nothing back, and no constructor is owed. §15.4’s
abandonment arm is the field it is being kept open for.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: BranchIdThe lineage’s own name.
parent: Option<BranchId>The lineage it was cut from, or None for the trunk.
forked_at: Option<String>The transaction-time instant it was cut at, or None for the trunk.
This is the visibility cutoff 0.14.6 reads: the branch sees its parent’s history up to and including this instant, and nothing the parent records after it (D-223).
created_at: StringWhen the row was written.
A separate column from forked_at rather than a duplicate of it, and
the two are equal for every branch this release can create. They are
separate so that forking from a past instant is an additive change
later: a historical fork has a forked_at behind its created_at, and
the schema has always allowed it — CHECK (forked_at <= created_at).
Trait Implementations§
impl Eq for Branch
Source§impl Ord for Branch
impl Ord for Branch
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Branch
impl PartialOrd for Branch
impl StructuralPartialEq for Branch
Auto Trait Implementations§
impl Freeze for Branch
impl RefUnwindSafe for Branch
impl Send for Branch
impl Sync for Branch
impl Unpin for Branch
impl UnsafeUnpin for Branch
impl UnwindSafe for Branch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request