Struct Identity

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

A user identity. This is a unique representation of an user.

Implementations§

Source§

impl Identity

Source

pub fn read_legacy( replica: &Replica, id: EntityId<Self>, ) -> Result<Vec<VersionEntry>, Error>

Fetch an Identity from it’s legacy encoding from a git repository and decode it.

The legacy encoding is used by git-bug. This is only useful, if you need fine grained access to the concrete data. If you simply want to access an Identity, use Identity::read instead.

§Errors

If the associated git operations fail.

Trait Implementations§

Source§

impl Debug for Identity

Source§

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

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

impl<'de> Deserialize<'de> for Identity

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Entity for Identity

Source§

const FORMAT_VERSION: usize = 4usize

The expected format version number, that can be used for data migration/upgrade.
Source§

const NAMESPACE: &str = "identities"

The namespace in git references (bugs, prs, …).
Source§

const TYPENAME: &str = "Identity"

The name of the entity (issue, pull-request, …), for human consumption.
Source§

type HistoryStep = IdentityHistoryStep

A step in the history of a Snapshot's Timeline.
Source§

type OperationData = IdentityOperationData

The type of Operation this Entity uses.
Source§

type Timeline = IdentityTimeline

The complete timeline of an Snapshot of this Entity.
Source§

fn operations(&self) -> &Operations<Self>
where Self: Sized,

Return the Operations that compose this Entity.
Source§

unsafe fn from_parts( operations: Operations<Self>, create_time: Time, edit_time: Time, current_head: ObjectId, ) -> Self
where Self: Sized,

Construct this instance from the data stored on disk. Read more
Source§

fn create_time(&self) -> &Time
where Self: Sized,

Return the lamport::Time that was set, when this Entity was first created.
Source§

fn edit_time(&self) -> &Time
where Self: Sized,

Return the lamport::Time that was set, when this Entity was last edited.
Source§

fn current_head(&self) -> &oid
where Self: Sized,

Return the commit object id of the last commit that added operations to this Entity.
Source§

fn id(&self) -> EntityId<Self>
where Self: Sized,

Return this Entity’s EntityId.
Source§

fn snapshot(&self) -> Snapshot<Self>

Generate a snapshot of this Entity. This is a frozen collection of this Entity's Operations. Read more
Source§

impl EntityRead for Identity

Source§

type CustomReadError = Error

An error that can be used to add to the default Error in read. Read more
Source§

fn read(replica: &Replica, id: EntityId<Self>) -> Result<Self, Error<Self>>
where Self: Sized,

Fetch this Entity from a git repository and decode it. Read more
Source§

fn last_git_commit( replica: &Replica, id: EntityId<Self>, ) -> Result<ObjectId, Error>

Get the commit associated with the last entry of this Entity's Operations. Read more
A breadth-first search to get a topological order of the Operations DAG where we discover the parents commit and go back in time up to the chronological root Read more
Source§

impl Serialize for Identity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Timeline<Identity> for IdentityTimeline

Source§

fn new() -> Self

Construct a new, empty Timeline.
Source§

fn from_root_operation(operation: &Operation<Identity>) -> Self

Construct an Timeline from a root operation.
Source§

fn add(&mut self, op: &Operation<Identity>)

Add an operation to this timeline.
Source§

fn history(&self) -> &[<Identity as Entity>::HistoryStep]

Return the complete history. 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> 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, 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,