Skip to main content

Reclaim

Struct Reclaim 

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

Соединение с GNUnet RECLAIM. Незавершённые операции C-клиент сам повторяет после переподключения; drop Future отменяет операцию.

Implementations§

Source§

impl Reclaim

Source

pub async fn connect( runtime: &GnunetRuntime, config: &Config, ) -> Result<Self, ReclaimError>

Подключается к сервису RECLAIM.

Source

pub async fn attribute_store( &self, identity: &PrivateKey, attribute: &ReclaimAttribute, expiration: Duration, ) -> Result<(), ReclaimError>

Записывает атрибут identity. У нового атрибута id нулевой — сервис назначит его сам; узнать его можно через Reclaim::attributes.

Source

pub async fn attribute_delete( &self, identity: &PrivateKey, attribute: &ReclaimAttribute, ) -> Result<(), ReclaimError>

Удаляет атрибут (по его id) вместе с выданными на него tickets.

Source

pub async fn credential_store( &self, identity: &PrivateKey, credential: &ReclaimCredential, expiration: Duration, ) -> Result<(), ReclaimError>

Записывает credential identity.

Source

pub async fn credential_delete( &self, identity: &PrivateKey, credential: &ReclaimCredential, ) -> Result<(), ReclaimError>

Удаляет credential (по его id).

Source

pub async fn attributes( &self, identity: &PrivateKey, ) -> Result<Vec<ReclaimAttribute>, ReclaimError>

Все атрибуты identity (get_attributes_start/next/stop): следующий элемент запрашивается после приёма предыдущего, drop Future останавливает обход.

Source

pub async fn credentials( &self, identity: &PrivateKey, ) -> Result<Vec<ReclaimCredential>, ReclaimError>

Все credentials identity (get_credentials_start/next/stop).

Source

pub async fn tickets( &self, identity: &PrivateKey, ) -> Result<Vec<(ReclaimTicket, String)>, ReclaimError>

Все tickets, выданные identity, вместе с адресом получателя (ticket_iteration_start/next/stop).

Сервис 0.29.0 присылает tickets подряд, не дожидаясь запроса следующего, а на запоздавший next/stop разрывает соединение, поэтому обёртка их не отправляет: при drop Future обход дочитывается в фоне.

Source

pub async fn ticket_issue( &self, identity: &PrivateKey, rp_uri: &str, attributes: &[ReclaimAttribute], ) -> Result<IssuedTicket, ReclaimError>

Выдаёт получателю rp_uri ticket на перечисленные атрибуты.

Source

pub async fn ticket_consume( &self, ticket: &ReclaimTicket, rp_uri: &str, ) -> Result<ConsumedTicket, ReclaimError>

Получает атрибуты по ticket от имени получателя rp_uri.

Source

pub async fn ticket_revoke( &self, identity: &PrivateKey, ticket: &ReclaimTicket, ) -> Result<(), ReclaimError>

Отзывает ticket: получатель теряет доступ к атрибутам.

Source

pub async fn close(self) -> Result<(), ReclaimError>

Отменяет незавершённые операции и дожидается локального GNUNET_RECLAIM_disconnect.

Trait Implementations§

Source§

impl Drop for Reclaim

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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, 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.