pub struct Invite {Show 13 fields
pub inviter_device_pubkey: DevicePubkey,
pub inviter_ephemeral_public_key: DevicePubkey,
pub shared_secret: [u8; 32],
pub inviter_ephemeral_private_key: Option<[u8; 32]>,
pub max_uses: Option<usize>,
pub used_by: Vec<DevicePubkey>,
pub used_response_contents: Vec<String>,
pub created_at: UnixSeconds,
pub inviter_owner_pubkey: Option<OwnerPubkey>,
pub purpose: Option<String>,
pub inviter: PublicKey,
pub device_id: Option<String>,
pub owner_public_key: Option<PublicKey>,
}Fields§
§inviter_device_pubkey: DevicePubkey§inviter_ephemeral_public_key: DevicePubkey§inviter_ephemeral_private_key: Option<[u8; 32]>§max_uses: Option<usize>§used_by: Vec<DevicePubkey>§used_response_contents: Vec<String>§created_at: UnixSeconds§inviter_owner_pubkey: Option<OwnerPubkey>§purpose: Option<String>§inviter: PublicKey§device_id: Option<String>§owner_public_key: Option<PublicKey>Implementations§
Source§impl Invite
impl Invite
pub fn create_new( inviter: PublicKey, device_id: Option<String>, max_uses: Option<usize>, ) -> Result<Invite, Error>
pub fn create_new_with_context<R>( ctx: &mut ProtocolContext<'_, R>, inviter_device_pubkey: DevicePubkey, inviter_owner_pubkey: Option<OwnerPubkey>, max_uses: Option<usize>, ) -> Result<Invite, Error>
pub fn serialize(&self) -> Result<String, Error>
pub fn deserialize(json: &str) -> Result<Invite, Error>
pub fn accept( &self, invitee_public_key: PublicKey, invitee_private_key: [u8; 32], device_id: Option<String>, ) -> Result<(Session, InviteResponseEnvelope), Error>
pub fn accept_with_owner( &self, invitee_public_key: PublicKey, invitee_private_key: [u8; 32], device_id: Option<String>, owner_public_key: Option<PublicKey>, ) -> Result<(Session, InviteResponseEnvelope), Error>
pub fn accept_with_context<R>( &self, ctx: &mut ProtocolContext<'_, R>, invitee_public_key: DevicePubkey, invitee_private_key: [u8; 32], ) -> Result<(Session, InviteResponseEnvelope), Error>
pub fn accept_with_owner_context<R>( &self, ctx: &mut ProtocolContext<'_, R>, invitee_public_key: DevicePubkey, invitee_private_key: [u8; 32], invitee_owner_pubkey: Option<OwnerPubkey>, ) -> Result<(Session, InviteResponseEnvelope), Error>
pub fn process_response<R>( &mut self, ctx: &mut ProtocolContext<'_, R>, envelope: &InviteResponseEnvelope, inviter_private_key: [u8; 32], ) -> Result<InviteResponse, Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Invite
impl<'de> Deserialize<'de> for Invite
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Invite, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Invite, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Invite
Source§impl InviteNostrExt for Invite
impl InviteNostrExt for Invite
fn get_url(&self, root: &str) -> Result<String, Error>
fn get_event(&self) -> Result<UnsignedEvent, Error>
fn from_url(url: &str) -> Result<Invite, Error>
fn from_event(event: &Event) -> Result<Invite, Error>
fn process_invite_response( &self, event: &Event, inviter_private_key: [u8; 32], ) -> Result<Option<InviteResponse>, Error>
Source§impl Serialize for Invite
impl Serialize for Invite
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Invite
Auto Trait Implementations§
impl Freeze for Invite
impl RefUnwindSafe for Invite
impl Send for Invite
impl Sync for Invite
impl Unpin for Invite
impl UnsafeUnpin for Invite
impl UnwindSafe for Invite
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
Mutably borrows from an owned value. Read more