pub struct Agent { /* private fields */ }
Implementations§
Source§impl Agent
impl Agent
pub fn new( agent_key: AgentKey, protocols: Vec<Protocol>, router: Option<Box<dyn Router>>, did_resolver: Option<Box<dyn DidResolver>>, ) -> Self
pub fn get_root(&self) -> &Vec<Hash>
pub fn tenant(&self) -> &Did
pub async fn create( &self, parent_path: &[Hash], permission_options: Option<&PermissionOptions>, record: Record, dids: Option<&[&Did]>, ) -> Result<Vec<Hash>, Error>
pub async fn read( &self, path: &[Hash], index: Option<(usize, Option<usize>)>, dids: Option<&[&Did]>, ) -> Result<Option<Record>, Error>
pub async fn update( &self, path: &[Hash], permission_options: Option<&PermissionOptions>, record: Record, dids: Option<&[&Did]>, ) -> Result<(), Error>
pub async fn delete( &self, path: &[Hash], dids: Option<&[&Did]>, ) -> Result<bool, Error>
pub async fn scan(&self) -> Result<(), Error>
pub async fn public_create( &self, record: Record, index: Index, dids: Option<&[&Did]>, ) -> Result<(), Error>
pub async fn public_read( &self, filters: Filters, sort_options: Option<SortOptions>, dids: Option<&[&Did]>, ) -> Result<Vec<(Verifier, Record)>, Error>
pub async fn public_update( &self, record: Record, index: Index, dids: Option<&[&Did]>, ) -> Result<(), Error>
pub async fn public_delete( &self, record_id: Hash, dids: Option<&[&Did]>, ) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl !UnwindSafe for Agent
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