Skip to main content

IdentityUpdates

Struct IdentityUpdates 

Source
pub struct IdentityUpdates<Context> { /* private fields */ }

Implementations§

Source§

impl<Context> IdentityUpdates<Context>

Source

pub fn new(context: Context) -> IdentityUpdates<Context>

Source§

impl<'a, Context> IdentityUpdates<Context>
where Context: IdentityContext,

Source

pub async fn batch_get_association_state( &self, conn: &impl DbQuery, identifiers: &[(impl AsIdRef, Option<i64>)], ) -> Result<Vec<AssociationState>, IdentityUpdateError>

Get the association state for all provided inbox_id/optional sequence_id tuples, using the cache when available If the association state is not available in the cache, this falls back to reconstructing the association state from Identity Updates in the network.

At most IDENTITY_DEPENDENCY_CONCURRENCY states are derived at once, and the states are returned in the order of identifiers.

Source

pub async fn get_latest_association_state( &self, conn: &DbConnection<<<Context as CoreContext>::Db as XmtpDb>::Connection>, inbox_id: &'a str, ) -> Result<AssociationState, IdentityUpdateError>

Get the latest association state available on the network for the given inbox_id

Source

pub async fn with_own_installation_events<T>( &self, conn: &impl DbQuery, load: Pin<Box<impl Future<Output = Result<T, IdentityUpdateError>>>>, ) -> Result<T, IdentityUpdateError>

Run load, which can store updates of this client’s own inbox, with own-inbox loads serialized. Then, whether load succeeded or failed, emit the own-installation changes of every own-inbox update stored since the last emission. A load that stores pages and then fails, including the reload after a publish conflict, therefore still reports what it stored. Updates whose emission does not happen, because load was dropped or the emission failed, are emitted after the next own-inbox load. load is boxed to keep callers’ futures small: SDK worker futures have a size limit.

Source

pub async fn get_association_state( &self, conn: &impl DbQuery, inbox_id: &str, to_sequence_id: Option<i64>, ) -> Result<AssociationState, IdentityUpdateError>

Get the association state for a given inbox_id up to the (and inclusive of) the to_sequence_id If no to_sequence_id is provided, use the latest value in the database

Source

pub async fn create_inbox( &self, identifier: Identifier, maybe_nonce: Option<u64>, ) -> Result<SignatureRequest, IdentityUpdateError>

Generate a CreateInbox signature request for the given wallet address. If no nonce is provided, use 0

Source

pub async fn associate_identity( &self, new_identifier: Identifier, ) -> Result<SignatureRequest, IdentityUpdateError>

Generate a AssociateWallet signature request using an existing wallet and a new wallet address

Source

pub async fn claim_handle_request( &self, handle: Handle, ) -> Result<SignatureRequest, IdentityUpdateError>

Generate a ClaimHandle signature request for handle, signed by this installation’s key.

Source

pub async fn revoke_identities( &self, identities_to_revoke: Vec<Identifier>, ) -> Result<SignatureRequest, IdentityUpdateError>

Revoke the given identities from the association state for the client’s inbox. More identities than one identity update may revoke fail before any network read.

Source

pub async fn revoke_installations( &self, installation_ids: Vec<Vec<u8>>, ) -> Result<SignatureRequest, IdentityUpdateError>

Revoke the given installations from the association state for the client’s inbox

Source

pub async fn change_recovery_identifier( &self, new_recovery_identifier: Identifier, ) -> Result<SignatureRequest, IdentityUpdateError>

Generate a ChangeRecoveryAddress signature request using a new identifier

Source

pub async fn apply_signature_request( &self, signature_request: SignatureRequest, ) -> Result<(), IdentityUpdateError>

Apply a signature request to the client’s inbox by publishing the identity update to the network.

This will error if the signature request is missing signatures, if the signatures are invalid, if the update fails other verifications, or if the update fails to be published to the network.

Source

pub async fn get_installation_diff( &self, conn: &impl DbQuery, group_id: &GroupId, old_group_membership: &GroupMembership, new_group_membership: &GroupMembership, membership_diff: &MembershipDiff<'_>, ) -> Result<InstallationDiff, InstallationDiffError>

Given two group memberships and the diff, get the list of installations that were added or removed between the two membership states.

Auto Trait Implementations§

§

impl<Context> Freeze for IdentityUpdates<Context>
where Context: Freeze,

§

impl<Context> RefUnwindSafe for IdentityUpdates<Context>
where Context: RefUnwindSafe,

§

impl<Context> Send for IdentityUpdates<Context>
where Context: Send,

§

impl<Context> Sync for IdentityUpdates<Context>
where Context: Sync,

§

impl<Context> Unpin for IdentityUpdates<Context>
where Context: Unpin,

§

impl<Context> UnsafeUnpin for IdentityUpdates<Context>
where Context: UnsafeUnpin,

§

impl<Context> UnwindSafe for IdentityUpdates<Context>
where Context: UnwindSafe,

Blanket Implementations§

§

impl<T> AggregateExpressionMethods for T

§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WindowExpressionMethods for T

§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> MaybeSend for T
where T: Send + ?Sized,

§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,