pub struct EdgeEngine { /* private fields */ }Expand description
Lightweight authorization engine for edge deployment
Implementations§
Source§impl EdgeEngine
impl EdgeEngine
Sourcepub async fn new(config: EdgeConfig) -> Result<Self>
pub async fn new(config: EdgeConfig) -> Result<Self>
Create a new edge engine
Sourcepub async fn check(
&self,
namespace: &str,
object_id: &str,
relation: &str,
subject_id: &str,
) -> Result<bool>
pub async fn check( &self, namespace: &str, object_id: &str, relation: &str, subject_id: &str, ) -> Result<bool>
Check authorization (fast, in-memory)
Sourcepub async fn write_tuple(&self, tuple: RelationTuple) -> Result<()>
pub async fn write_tuple(&self, tuple: RelationTuple) -> Result<()>
Write a tuple (with CRDT metadata)
Sourcepub async fn delete_tuple(&self, tuple: RelationTuple) -> Result<()>
pub async fn delete_tuple(&self, tuple: RelationTuple) -> Result<()>
Delete a tuple (creates tombstone)
Sourcepub async fn sync_from_central(&self) -> Result<()>
pub async fn sync_from_central(&self) -> Result<()>
Sync tuples from central database
Sourcepub async fn start_sync(&self) -> Result<()>
pub async fn start_sync(&self) -> Result<()>
Start background sync task
Sourcepub async fn merge_remote_tuples(
&self,
remote_tuples: Vec<CrdtTuple>,
) -> Result<u64>
pub async fn merge_remote_tuples( &self, remote_tuples: Vec<CrdtTuple>, ) -> Result<u64>
Merge tuples from another edge node (for gossip protocol)
Sourcepub async fn gc_tombstones(&self, retention_secs: u64) -> Result<()>
pub async fn gc_tombstones(&self, retention_secs: u64) -> Result<()>
Garbage collect old tombstones
Auto Trait Implementations§
impl Freeze for EdgeEngine
impl !RefUnwindSafe for EdgeEngine
impl Send for EdgeEngine
impl Sync for EdgeEngine
impl Unpin for EdgeEngine
impl !UnwindSafe for EdgeEngine
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more