Skip to main content

Account

Struct Account 

Source
pub struct Account<K: Kind> { /* private fields */ }
Expand description

The one account of the content a request walked in with: what that content IS, and what it declares it stands on.

Every reading of a request’s content reads THIS value — the intent derived from it, the triggers that watch it, the declaration that caused it, the node it stands at — and none of them keeps a copy. A second list of what content depends on would agree with this one until it did not, and nothing downstream could tell which of the two a plan was planned over.

§Nonclaims

It says nothing about whether the commitment is current, reachable, or admitted anywhere: it is the address the caller handed over, read exactly.

Implementations§

Source§

impl<K: Kind> Account<K>

Source

pub fn anchoring(&self) -> Anchoring

What a transcript derived over this account hangs off.

Read off the account’s own commitment, so a plan’s anchor and a plan’s stated cause are one fact rather than two that could disagree.

Source

pub fn origin_node(&self) -> Identity<OriginNode>

The origin node this account’s content stands at.

Derived under the content commitment, so changing its kind, captured declaration, or canonical content moves the node through the binding’s stronger identity rather than a second restatement of those facts.

Source

pub fn dependency_edges(&self) -> Vec<OriginEdge>

The origin edges this account contributes: one per declared dependency, each running from what the content stands on to the content itself.

The relation is OriginRelation::ExplicitLink because that is what happened — an author supplied this dependency set at the door. It is no semantic derivation: nothing here derived meaning from a dependency.

§Ordering

The edges are a FAN-IN and not a walk: every one of them ends at Account::origin_node, so consecutive edges do not join and the set is not a trail. A caller draws trails through these edges one at a time rather than handing the set to a trail constructor, which would refuse the discontinuity — correctly.

Source

pub fn cause_triggers(&self) -> Vec<InvalidationTrigger>

The triggers that watch this account’s commitment and every dependency it declares.

Source

pub fn cause_trigger(&self) -> Result<InvalidationTrigger, PlanError>

The single trigger that watches this account’s own content.

The deliberately narrow reading, for a caller that can carry one trigger and no more.

§Errors

Returns PlanIssue::CauseSetUnwatchable where the account also names dependencies: one trigger cannot state that cause set, and a watch covering the commitment alone would read exactly like a complete one.

Source§

impl<K: Kind> Account<K>

Source

pub fn intent_bytes(&self) -> Vec<u8>

The intent’s canonical bytes on their own — the exact preimage Account::intent is derived over.

Written from the pair and never read back off the identity: a preimage road that spelled the digest would hand back thirty-two bytes nobody can re-derive anything from, and the derivation it feeds would be defined in terms of its own output.

Source

pub fn encode_into(&self, into: &mut Vec<u8>)

Appends this account’s canonical bytes: the intent preimage, then the dependency set, canonicalized.

The account’s bytes therefore BEGIN with exactly the intent’s preimage, through the same road Account::intent_bytes hands back, rather than through a second spelling that happens to agree today.

Source§

impl<K: Kind> Account<K>

Source

pub fn over(binding: ContentBinding<K>) -> Self

The account of content that stands on nothing.

Source

pub fn standing_on( binding: ContentBinding<K>, dependencies: Vec<Identity<CapturedDeclaration>>, ) -> Result<Self, PlanError>

The account of content that stands on the captures the caller declares.

The set is canonicalized here — ordered by identity, exact repeats dropped — so two callers declaring one set in two orders reach one plan.

§Errors

Returns the planning refusal naming BoundAxis::Declarations where the declared set outgrows DEPENDENCY_LIMIT.

Source

pub const fn commitment(&self) -> Identity<CapturedDeclaration>

The one address the caller supplied at the door.

The reading a plan’s anchor, its causing-declaration answer, and its own trigger are all taken from — one value read three times rather than three seats that could disagree.

Source

pub const fn kind(&self) -> Identity<ProjectionKind>

The owner-qualified kind identity this account carries.

Source

pub const fn content_commitment(&self) -> Identity<ProjectionContent>

The commitment over the kind-specific content’s canonical bytes.

Source

pub const fn content(&self) -> &K::Content

The kind-specific content itself.

Source

pub fn dependencies(&self) -> &[Identity<CapturedDeclaration>]

The captures this content declares it stands on, in canonical order.

Source

pub fn intent(&self) -> Intent

What was MEANT: the owner-qualified kind over the content commitment, derived into the intent layer’s own identity.

The preimage is Account::intent_bytes, derived at Role::ProjectionIntent, rooted, at position zero. Rooted deliberately: the preimage already carries the commitment at full width, so anchoring on that same commitment would write it twice into one derivation and separate nothing.

Trait Implementations§

Source§

impl<K: Clone + Kind> Clone for Account<K>

Source§

fn clone(&self) -> Account<K>

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<K: Debug + Kind> Debug for Account<K>

Source§

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

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

impl<K: Eq + Kind> Eq for Account<K>

Source§

impl<K: PartialEq + Kind> PartialEq for Account<K>

Source§

fn eq(&self, other: &Account<K>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<K: PartialEq + Kind> StructuralPartialEq for Account<K>

Auto Trait Implementations§

§

impl<K> Freeze for Account<K>

§

impl<K> RefUnwindSafe for Account<K>

§

impl<K> Send for Account<K>
where ContentBinding<K>: Send,

§

impl<K> Sync for Account<K>
where ContentBinding<K>: Sync,

§

impl<K> Unpin for Account<K>

§

impl<K> UnsafeUnpin for Account<K>

§

impl<K> UnwindSafe for Account<K>

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 = !

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.