Struct zkgroup::api::groups::GroupSendEndorsement
source · pub struct GroupSendEndorsement<Storage = RistrettoPoint> { /* private fields */ }
Expand description
A single endorsement, for one or multiple group members.
Storage
is usually [curve25519_dalek_signal::RistrettoPoint
], but the receive
APIs on
GroupSendEndorsementsResponse
produce “compressed” endorsements, since they are usually
immediately serialized.
Implementations§
source§impl GroupSendEndorsement<CompressedRistretto>
impl GroupSendEndorsement<CompressedRistretto>
sourcepub fn decompress(
self,
) -> Result<GroupSendEndorsement<RistrettoPoint>, ZkGroupDeserializationFailure>
pub fn decompress( self, ) -> Result<GroupSendEndorsement<RistrettoPoint>, ZkGroupDeserializationFailure>
Attempts to decompress the GroupSendEndorsement.
Produces ZkGroupDeserializationFailure
if the compressed storage isn’t a valid
representation of a point.
Deserializing an GroupSendEndorsement<RistrettoPoint>
is equivalent to deserializing an
GroupSendEndorsement<CompressedRistretto>
and then calling decompress
.
source§impl GroupSendEndorsement<RistrettoPoint>
impl GroupSendEndorsement<RistrettoPoint>
sourcepub fn compress(self) -> GroupSendEndorsement<CompressedRistretto>
pub fn compress(self) -> GroupSendEndorsement<CompressedRistretto>
Compresses the GroupSendEndorsement for storage.
Serializing an GroupSendEndorsement<RistrettoPoint>
is equivalent to calling compress
and
serializing the resulting GroupSendEndorsement<CompressedRistretto>
.
source§impl GroupSendEndorsement
impl GroupSendEndorsement
sourcepub fn combine(
endorsements: impl IntoIterator<Item = GroupSendEndorsement>,
) -> GroupSendEndorsement
pub fn combine( endorsements: impl IntoIterator<Item = GroupSendEndorsement>, ) -> GroupSendEndorsement
Combines several endorsements into one.
All endorsements must have been generated from the same issuance, or the resulting endorsement will not produce a valid token.
This is a set-like operation: order does not matter.
sourcepub fn remove(
&self,
unwanted_endorsements: &GroupSendEndorsement,
) -> GroupSendEndorsement
pub fn remove( &self, unwanted_endorsements: &GroupSendEndorsement, ) -> GroupSendEndorsement
Removes endorsements from a previously-combined endorsement.
Removing endorsements not present in self
will result in an endorsement that will not
produce a valid token.
This is a set-like operation: order does not matter. Multiple endorsements can be removed by calling this method repeatedly, or by removing a single combined endorsement.
sourcepub fn to_token(&self, group_params: &GroupSecretParams) -> GroupSendToken
pub fn to_token(&self, group_params: &GroupSecretParams) -> GroupSendToken
Generates a bearer token from the endorsement.
This can be cached by the client for repeatedly sending to the same recipient, but must be converted to a GroupSendFullToken before sending it to the server.
Trait Implementations§
source§impl<Storage: Clone> Clone for GroupSendEndorsement<Storage>
impl<Storage: Clone> Clone for GroupSendEndorsement<Storage>
source§fn clone(&self) -> GroupSendEndorsement<Storage>
fn clone(&self) -> GroupSendEndorsement<Storage>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GroupSendEndorsement<RistrettoPoint>
impl Debug for GroupSendEndorsement<RistrettoPoint>
source§impl Debug for GroupSendEndorsement<CompressedRistretto>
impl Debug for GroupSendEndorsement<CompressedRistretto>
source§impl<'de, Storage> Deserialize<'de> for GroupSendEndorsement<Storage>where
Storage: Deserialize<'de>,
impl<'de, Storage> Deserialize<'de> for GroupSendEndorsement<Storage>where
Storage: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<Storage> PartialDefault for GroupSendEndorsement<Storage>where
Storage: Identity,
impl<Storage> PartialDefault for GroupSendEndorsement<Storage>where
Storage: Identity,
source§fn partial_default() -> Self
fn partial_default() -> Self
source§impl<Storage> PartialEq for GroupSendEndorsement<Storage>where
Storage: ConstantTimeEq,
impl<Storage> PartialEq for GroupSendEndorsement<Storage>where
Storage: ConstantTimeEq,
source§impl<Storage> Serialize for GroupSendEndorsement<Storage>where
Storage: Serialize,
impl<Storage> Serialize for GroupSendEndorsement<Storage>where
Storage: Serialize,
impl<Storage: Copy> Copy for GroupSendEndorsement<Storage>
Auto Trait Implementations§
impl<Storage> Freeze for GroupSendEndorsement<Storage>where
Storage: Freeze,
impl<Storage> RefUnwindSafe for GroupSendEndorsement<Storage>where
Storage: RefUnwindSafe,
impl<Storage> Send for GroupSendEndorsement<Storage>where
Storage: Send,
impl<Storage> Sync for GroupSendEndorsement<Storage>where
Storage: Sync,
impl<Storage> Unpin for GroupSendEndorsement<Storage>where
Storage: Unpin,
impl<Storage> UnwindSafe for GroupSendEndorsement<Storage>where
Storage: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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