pub struct Reclaim { /* private fields */ }Expand description
Соединение с GNUnet RECLAIM. Незавершённые операции C-клиент сам повторяет после переподключения; drop Future отменяет операцию.
Implementations§
Source§impl Reclaim
impl Reclaim
Sourcepub async fn connect(
runtime: &GnunetRuntime,
config: &Config,
) -> Result<Self, ReclaimError>
pub async fn connect( runtime: &GnunetRuntime, config: &Config, ) -> Result<Self, ReclaimError>
Подключается к сервису RECLAIM.
Sourcepub async fn attribute_store(
&self,
identity: &PrivateKey,
attribute: &ReclaimAttribute,
expiration: Duration,
) -> Result<(), ReclaimError>
pub async fn attribute_store( &self, identity: &PrivateKey, attribute: &ReclaimAttribute, expiration: Duration, ) -> Result<(), ReclaimError>
Записывает атрибут identity. У нового атрибута id нулевой — сервис
назначит его сам; узнать его можно через Reclaim::attributes.
Sourcepub async fn attribute_delete(
&self,
identity: &PrivateKey,
attribute: &ReclaimAttribute,
) -> Result<(), ReclaimError>
pub async fn attribute_delete( &self, identity: &PrivateKey, attribute: &ReclaimAttribute, ) -> Result<(), ReclaimError>
Удаляет атрибут (по его id) вместе с выданными на него tickets.
Sourcepub async fn credential_store(
&self,
identity: &PrivateKey,
credential: &ReclaimCredential,
expiration: Duration,
) -> Result<(), ReclaimError>
pub async fn credential_store( &self, identity: &PrivateKey, credential: &ReclaimCredential, expiration: Duration, ) -> Result<(), ReclaimError>
Записывает credential identity.
Sourcepub async fn credential_delete(
&self,
identity: &PrivateKey,
credential: &ReclaimCredential,
) -> Result<(), ReclaimError>
pub async fn credential_delete( &self, identity: &PrivateKey, credential: &ReclaimCredential, ) -> Result<(), ReclaimError>
Удаляет credential (по его id).
Sourcepub async fn attributes(
&self,
identity: &PrivateKey,
) -> Result<Vec<ReclaimAttribute>, ReclaimError>
pub async fn attributes( &self, identity: &PrivateKey, ) -> Result<Vec<ReclaimAttribute>, ReclaimError>
Все атрибуты identity (get_attributes_start/next/stop): следующий
элемент запрашивается после приёма предыдущего, drop Future
останавливает обход.
Sourcepub async fn credentials(
&self,
identity: &PrivateKey,
) -> Result<Vec<ReclaimCredential>, ReclaimError>
pub async fn credentials( &self, identity: &PrivateKey, ) -> Result<Vec<ReclaimCredential>, ReclaimError>
Все credentials identity (get_credentials_start/next/stop).
Sourcepub async fn tickets(
&self,
identity: &PrivateKey,
) -> Result<Vec<(ReclaimTicket, String)>, ReclaimError>
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 обход дочитывается
в фоне.
Sourcepub async fn ticket_issue(
&self,
identity: &PrivateKey,
rp_uri: &str,
attributes: &[ReclaimAttribute],
) -> Result<IssuedTicket, ReclaimError>
pub async fn ticket_issue( &self, identity: &PrivateKey, rp_uri: &str, attributes: &[ReclaimAttribute], ) -> Result<IssuedTicket, ReclaimError>
Выдаёт получателю rp_uri ticket на перечисленные атрибуты.
Sourcepub async fn ticket_consume(
&self,
ticket: &ReclaimTicket,
rp_uri: &str,
) -> Result<ConsumedTicket, ReclaimError>
pub async fn ticket_consume( &self, ticket: &ReclaimTicket, rp_uri: &str, ) -> Result<ConsumedTicket, ReclaimError>
Получает атрибуты по ticket от имени получателя rp_uri.
Sourcepub async fn ticket_revoke(
&self,
identity: &PrivateKey,
ticket: &ReclaimTicket,
) -> Result<(), ReclaimError>
pub async fn ticket_revoke( &self, identity: &PrivateKey, ticket: &ReclaimTicket, ) -> Result<(), ReclaimError>
Отзывает ticket: получатель теряет доступ к атрибутам.
Sourcepub async fn close(self) -> Result<(), ReclaimError>
pub async fn close(self) -> Result<(), ReclaimError>
Отменяет незавершённые операции и дожидается локального
GNUNET_RECLAIM_disconnect.