pub struct Groups<'a> { /* private fields */ }Implementations§
Source§impl<'a> Groups<'a>
impl<'a> Groups<'a>
pub async fn query_info(&self, jid: &Jid) -> Result<GroupInfo, Error>
pub async fn get_participating( &self, ) -> Result<HashMap<String, GroupMetadata>, Error>
pub async fn get_metadata(&self, jid: &Jid) -> Result<GroupMetadata, Error>
pub async fn create_group( &self, options: GroupCreateOptions, ) -> Result<CreateGroupResult, Error>
pub async fn set_subject( &self, jid: &Jid, subject: GroupSubject, ) -> Result<(), Error>
Sourcepub async fn set_description(
&self,
jid: &Jid,
description: Option<GroupDescription>,
prev: Option<String>,
) -> Result<(), Error>
pub async fn set_description( &self, jid: &Jid, description: Option<GroupDescription>, prev: Option<String>, ) -> Result<(), Error>
Sets or deletes a group’s description.
prev is the current description ID (from group metadata) used for
conflict detection. Pass None if unknown.
pub async fn leave(&self, jid: &Jid) -> Result<(), Error>
pub async fn add_participants( &self, jid: &Jid, participants: &[Jid], ) -> Result<Vec<ParticipantChangeResponse>, Error>
pub async fn remove_participants( &self, jid: &Jid, participants: &[Jid], ) -> Result<Vec<ParticipantChangeResponse>, Error>
pub async fn promote_participants( &self, jid: &Jid, participants: &[Jid], ) -> Result<(), Error>
pub async fn demote_participants( &self, jid: &Jid, participants: &[Jid], ) -> Result<(), Error>
pub async fn get_invite_link( &self, jid: &Jid, reset: bool, ) -> Result<String, Error>
Sourcepub async fn set_locked(&self, jid: &Jid, locked: bool) -> Result<(), Error>
pub async fn set_locked(&self, jid: &Jid, locked: bool) -> Result<(), Error>
Lock the group so only admins can change group info.
Sourcepub async fn set_announce(&self, jid: &Jid, announce: bool) -> Result<(), Error>
pub async fn set_announce(&self, jid: &Jid, announce: bool) -> Result<(), Error>
Set announcement mode. When enabled, only admins can send messages.
Sourcepub async fn set_ephemeral(
&self,
jid: &Jid,
expiration: u32,
) -> Result<(), Error>
pub async fn set_ephemeral( &self, jid: &Jid, expiration: u32, ) -> Result<(), Error>
Set ephemeral (disappearing) messages timer on the group.
Common values: 86400 (24h), 604800 (7d), 7776000 (90d). Pass 0 to disable.
Sourcepub async fn set_membership_approval(
&self,
jid: &Jid,
mode: MembershipApprovalMode,
) -> Result<(), Error>
pub async fn set_membership_approval( &self, jid: &Jid, mode: MembershipApprovalMode, ) -> Result<(), Error>
Set membership approval mode. When on, new members must be approved by an admin.
Sourcepub async fn join_with_invite_code(
&self,
code: &str,
) -> Result<JoinGroupResult, Error>
pub async fn join_with_invite_code( &self, code: &str, ) -> Result<JoinGroupResult, Error>
Join a group using an invite code.
Sourcepub async fn join_with_invite_v4(
&self,
group_jid: &Jid,
code: &str,
expiration: i64,
admin_jid: &Jid,
) -> Result<JoinGroupResult, Error>
pub async fn join_with_invite_v4( &self, group_jid: &Jid, code: &str, expiration: i64, admin_jid: &Jid, ) -> Result<JoinGroupResult, Error>
Accept a V4 invite (received as a GroupInviteMessage, not a link).
Sourcepub async fn get_invite_info(&self, code: &str) -> Result<GroupMetadata, Error>
pub async fn get_invite_info(&self, code: &str) -> Result<GroupMetadata, Error>
Get group metadata from an invite code without joining.
Sourcepub async fn get_membership_requests(
&self,
jid: &Jid,
) -> Result<Vec<MembershipRequest>, Error>
pub async fn get_membership_requests( &self, jid: &Jid, ) -> Result<Vec<MembershipRequest>, Error>
Get pending membership approval requests.
Sourcepub async fn approve_membership_requests(
&self,
jid: &Jid,
participants: &[Jid],
) -> Result<Vec<ParticipantChangeResponse>, Error>
pub async fn approve_membership_requests( &self, jid: &Jid, participants: &[Jid], ) -> Result<Vec<ParticipantChangeResponse>, Error>
Approve pending membership requests.
Sourcepub async fn reject_membership_requests(
&self,
jid: &Jid,
participants: &[Jid],
) -> Result<Vec<ParticipantChangeResponse>, Error>
pub async fn reject_membership_requests( &self, jid: &Jid, participants: &[Jid], ) -> Result<Vec<ParticipantChangeResponse>, Error>
Reject pending membership requests.
Sourcepub async fn set_member_add_mode(
&self,
jid: &Jid,
mode: MemberAddMode,
) -> Result<(), Error>
pub async fn set_member_add_mode( &self, jid: &Jid, mode: MemberAddMode, ) -> Result<(), Error>
Set who can add members to the group.
Auto Trait Implementations§
impl<'a> Freeze for Groups<'a>
impl<'a> !RefUnwindSafe for Groups<'a>
impl<'a> Send for Groups<'a>
impl<'a> Sync for Groups<'a>
impl<'a> Unpin for Groups<'a>
impl<'a> UnsafeUnpin for Groups<'a>
impl<'a> !UnwindSafe for Groups<'a>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more