Struct OsGatewayAttributeGenerator

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

Creates and tracks all attributes needed to properly interact with Object Store Gateway.

Includes instantiation functions that ensure that all provided values are present before including them in an event.

Note: Repeatedly calling fluent functions will replace the previous value submitted via that function.

Implementations§

Source§

impl OsGatewayAttributeGenerator

Source

pub fn access_grant<S1: Into<String>, S2: Into<String>>( scope_address: S1, target_account_address: S2, ) -> Self

Generates the required values in the Cosmwasm Response struct in order to denote to Object Store Gateway that access needs to be granted to an account.

This event will be disregarded by the gateway unless the following criteria is met:

§Parameters
  • scope_address The bech32 address of the Provenance Blockchain Scope to which this access grant refers.
  • target_account_address The bech32 address of the Provenance Blockchain Account to which this access grant refers. The account will be able to retrieve all record data for the referred scope upon successful processing of this event.
Source

pub fn access_revoke<S1: Into<String>, S2: Into<String>>( scope_address: S1, target_account_address: S2, ) -> Self

Generates the required values in the Cosmwasm Response struct in order to denote to Object Store Gateway that access needs to be revoked from an account.

This event will be disregarded by the gateway unless the following criteria is met:

§Parameters
  • scope_address The bech32 address of the Provenance Blockchain Scope to which this access revoke refers.
  • target_account_address The bech32 address of the Provenance Blockchain Account to which this access revoke refers. The account will no longer be able to retrieve records for the given scope upon successful processing of this event.
Source

pub fn with_access_grant_id<S: Into<String>>(self, access_grant_id: S) -> Self

Includes a custom access grant unique identifier in an access request event structure.

This value behaves differently based on the type of event in which it is included:

  • Access Grants: This value will be used to establish a unique identifier in any Object Store Gateway which processes the event. This allows the revocation process to directly target a record.
  • Access Revokes: This value will be used to target a specific access grant to revoke. If this value is omitted, the default behavior is to remove all grants specified for a Provenance Blockchain Scope address and grantee Provenance Blockchain Account address combination at once.

Trait Implementations§

Source§

impl Clone for OsGatewayAttributeGenerator

Source§

fn clone(&self) -> OsGatewayAttributeGenerator

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OsGatewayAttributeGenerator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoIterator for OsGatewayAttributeGenerator

Source§

type Item = (String, String)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<OsGatewayAttributeGenerator as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.