Struct ockam::ProfileState [−][src]
pub struct ProfileState { /* fields omitted */ }Expand description
Profile implementation
Implementations
pub fn new(
identifier: EntityIdentifier,
change_events: Vec<ProfileChangeEvent, Global>,
contacts: HashMap<EntityIdentifier, Contact, RandomState, Global>,
vault: VaultSync,
rng: impl RngCore + CryptoRng + Clone
) -> ProfileState
pub fn new(
identifier: EntityIdentifier,
change_events: Vec<ProfileChangeEvent, Global>,
contacts: HashMap<EntityIdentifier, Contact, RandomState, Global>,
vault: VaultSync,
rng: impl RngCore + CryptoRng + Clone
) -> ProfileState
Profile constructor
pub async fn create_key_static(
prev_id: EventIdentifier,
key_attributes: KeyAttributes,
attributes: HashMap<String, String, RandomState, Global>,
root_key: Option<&'_ Secret>,
vault: &'_ mut VaultSync
) -> Result<ProfileChangeEvent, Error>
pub async fn create_key_static(
prev_id: EventIdentifier,
key_attributes: KeyAttributes,
attributes: HashMap<String, String, RandomState, Global>,
root_key: Option<&'_ Secret>,
vault: &'_ mut VaultSync
) -> Result<ProfileChangeEvent, Error>
Create a new key
Trait Implementations
pub fn async_try_clone<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ProfileState, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn async_try_clone<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ProfileState, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Try cloning a object and return an Err in case of failure.
pub fn get_profile_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Secret, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn get_profile_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Secret, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Get Secret key. Key is uniquely identified by label in KeyAttributes
Generate Proof of possession of Profile.
channel_state should be tied to channel’s cryptographical material (e.g. h value for Noise XX)
pub fn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
channel_state: &'life1 [u8],
responder_contact_id: &'life2 EntityIdentifier,
proof: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
ProfileState: 'async_trait,
pub fn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
channel_state: &'life1 [u8],
responder_contact_id: &'life2 EntityIdentifier,
proof: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
ProfileState: 'async_trait,
Verify Proof of possession of Profile with given ProfileIdentifier.
channel_state should be tied to channel’s cryptographical material (e.g. h value for Noise XX)
pub fn verify_changes<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn verify_changes<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Verify whole event chain of current Profile
pub fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<EntityIdentifier, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<EntityIdentifier, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Return unique Profile identifier, which is equal to sha256 of the root public key
Create new key.
pub fn rotate_profile_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn rotate_profile_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Rotate existing key.
Get Secret key.
pub fn get_profile_public_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn get_profile_public_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Get PublicKey.
Get PublicKey.
pub fn add_change<'life0, 'async_trait>(
&'life0 mut self,
change_event: ProfileChangeEvent
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn add_change<'life0, 'async_trait>(
&'life0 mut self,
change_event: ProfileChangeEvent
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Add a change event.
pub fn get_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileChangeEvent, Global>, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn get_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileChangeEvent, Global>, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
Return change history chain
Return all known to this profile Contacts
pub fn as_contact<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Contact, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn as_contact<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Contact, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
ProfileState: 'async_trait,
pub fn get_contact<'life0, 'life1, 'async_trait>(
&'life0 mut self,
id: &'life1 EntityIdentifier
) -> Pin<Box<dyn Future<Output = Result<Option<Contact>, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
ProfileState: 'async_trait,
pub fn get_contact<'life0, 'life1, 'async_trait>(
&'life0 mut self,
id: &'life1 EntityIdentifier
) -> Pin<Box<dyn Future<Output = Result<Option<Contact>, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
ProfileState: 'async_trait,
Return Contact with given ProfileIdentifier
Verify cryptographically whole event chain. Also verify sequence correctness
pub fn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 EntityIdentifier,
change_events: &'life2 [ProfileChangeEvent]
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ProfileState: 'async_trait,
pub fn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 EntityIdentifier,
change_events: &'life2 [ProfileChangeEvent]
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ProfileState: 'async_trait,
Verify and update known Contact with new ProfileChangeEvents
pub fn get_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
_lease_manager_route: &'life1 Route,
_org_id: String,
_bucket: String,
_ttl: usize
) -> Pin<Box<dyn Future<Output = Result<Lease, Error>> + Send + 'async_trait, Global>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
ProfileState: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for ProfileState
impl Send for ProfileState
impl Sync for ProfileState
impl Unpin for ProfileState
impl !UnwindSafe for ProfileState
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output; where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output; where
S: Into<Dispatch>,
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more