{"id":25411538,"url":"https://github.com/veminovici/euklid","last_synced_at":"2026-01-22T08:33:17.126Z","repository":{"id":57626280,"uuid":"404109696","full_name":"veminovici/euklid","owner":"veminovici","description":"A rust library for distributed causality, dot, version-vector, dotted-version-vector, CDR types: g-counter","archived":false,"fork":false,"pushed_at":"2022-03-18T08:45:36.000Z","size":191,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T04:38:44.124Z","etag":null,"topics":["causality","clock","crdt","distr","dotted-vector-clocks","dotted-version-vector","gcounter","replicas"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veminovici.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-07T20:09:56.000Z","updated_at":"2025-07-12T21:16:37.000Z","dependencies_parsed_at":"2022-08-31T05:40:34.389Z","dependency_job_id":null,"html_url":"https://github.com/veminovici/euklid","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/veminovici/euklid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veminovici%2Feuklid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veminovici%2Feuklid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veminovici%2Feuklid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veminovici%2Feuklid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veminovici","download_url":"https://codeload.github.com/veminovici/euklid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veminovici%2Feuklid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28659518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causality","clock","crdt","distr","dotted-vector-clocks","dotted-version-vector","gcounter","replicas"],"created_at":"2025-02-16T10:18:51.104Z","updated_at":"2026-01-22T08:33:17.110Z","avatar_url":"https://github.com/veminovici.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![rust](https://img.shields.io/badge/Rust-000000?style=for-the-badge\u0026logo=rust\u0026logoColor=white) Simplee...Euklid... \n\nJust another rust crate, this one implements CRDTs things.\n\n[![CI Pipeline](https://github.com/veminovici/euklid/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/veminovici/euklid/actions/workflows/ci.yml)\n[![Tag](https://img.shields.io/github/tag/veminovici/euklid)](https://github.com/veminovici/euklid)\n[![Last commit](https://img.shields.io/github/last-commit/veminovici/euklid)](https://github.com/veminovici/euklid)\n[![Repo size](https://img.shields.io/github/repo-size/veminovici/euklid)](https://github.com/veminovici/euklid)\n\n## 1. Causality\n\n### 1.1. Causality Enumeration\nThe crate defines the **CausalOrdering** enumeration which has 4 values:\n\n```rust\npub enum Causality {\n    /// An event precedes another event.\n    Precede,\n    /// An event is equal with another event.\n    Equal,\n    /// An event succeeds another event.\n    Succeed,\n    /// An event is concurrent with another event.\n    Concurrent,\n}\n```\n\n### 1.2. CausalityOrd Trait\nThe crate also defines **CausalOrd** trait which along with the **CasualOrdering** allows the caller\nto determine if there is any causality between two different instances of the **CausalOrd**.\n\n```rust\n/// A trait that compares two events and returns their causality relation.\npub trait CausalityOrd: PartialOrd {\n    /// Returns the causality relation between two entities.\n    fn causality_cmp(\u0026self, other: \u0026Self) -\u003e Causality {\n        match self.partial_cmp(other) {\n            Some(core::cmp::Ordering::Equal) =\u003e Causality::Equal,\n            Some(core::cmp::Ordering::Less) =\u003e Causality::Precede,\n            Some(core::cmp::Ordering::Greater) =\u003e Causality::Succeed,\n            None =\u003e Causality::Concurrent,\n        }\n    }\n}\n```\n\n## 2. Identities, Actors, and Counters Traits\n\n### 2.1. Identities\nThese are traits that define the *zero* and *one* values for a type.\n\n```rust\n/// Represents the identity value `zero`.\npub trait Zero {\n    /// Returns the `zero` value for the type.\n    fn zero() -\u003e Self;\n}\n\n/// represents the identity value `one`.\npub trait One {\n    /// Returns the `one` value for the type.\n    fn one() -\u003e Self;\n}\n```\n### 2.2. Actors and Counters\nThe *Actor* trait defines the expected traits for an actor identifies. The *Counter* trait defines the expected traits for a counter.\n\n```rust\npub trait Actor: Copy + Ord + Zero {}\npub trait Counter: Copy + PartialOrd + Add\u003cOutput = Self\u003e + AddAssign + Sub\u003cOutput = Self\u003e + SubAssign + Zero + One {}\n```\n\nThe crate implements the *Actor* and *Counter* traits for all basic numeric types: *usize*, *u8*, *u16*, ..., *i8*, *i16*, ...\n\n## 3. CvRDT and CmRDT Traits\n\n### 3.1. CvRDT Trait\nThe *CvRDT* trait defines the converging or state based merge synchronization.\n\n```rust\npub trait CvRDT {\n    /// Merge the given CRDT into the current CRDT.\n    fn merge(\u0026mut self, other: Self);\n}\n```\n\n### 3.2. CmRDT Trait\nThe *CmRDT* trait defines the commuting or operation based synchronization.\n\n```rust\npub trait CmRDT {\n    /// Op's must be idempotent, meaning any Op may be applied more than once.\n    type Op;\n\n    /// Apply an Op to the CRDT\n    fn apply(\u0026mut self, op: Self::Op);\n}\n```\n\n\n## 4. CRDTs\n\n### 4.1. Dot\u003cA: Actor, C: Counter\u003e\n### 4.2. VClock\n### 4.3. GCounter\n### 4.4. PNCounter","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveminovici%2Feuklid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveminovici%2Feuklid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveminovici%2Feuklid/lists"}