GroupManager

Struct GroupManager 

Source
pub struct GroupManager { /* private fields */ }

Implementations§

Source§

impl GroupManager

Source

pub fn new(local_device_id: DeviceId, router: Arc<Router>) -> Self

Source

pub fn register_device_key( &self, device_id: DeviceId, public_key: PublicKey, ) -> Result<()>

注册设备公钥到 TreeKEM 引擎

Source

pub async fn create_group( &self, name: String, initial_members: Vec<DeviceId>, ) -> Result<Group>

Source

pub async fn add_member( &self, group_id: GroupId, device_id: DeviceId, ) -> Result<()>

Source

pub async fn join_group(&self, group: Group) -> Result<()>

Source

pub async fn leave_group(&self, group_id: GroupId) -> Result<()>

Source

pub async fn get_group(&self, group_id: GroupId) -> Option<Group>

Source

pub fn clear_groups(&self)

清理所有群组信息,防止内存泄漏 - use proper entry removal to avoid DashMap fragmentation

Source

pub async fn broadcast( &self, group_id: GroupId, payload: MessagePayload, ) -> Result<Uuid>

Source

pub async fn mark_device_success(&self, msg_id: Uuid, device_id: DeviceId)

标记设备为成功接收(收到ACK)

Source

pub async fn mark_device_failed(&self, msg_id: Uuid, device_id: DeviceId)

标记设备为失败(无法送达或超时)

Source

pub async fn get_ack_status( &self, msg_id: Uuid, ) -> Option<(usize, usize, usize)>

获取消息ACK状态

Source

pub async fn rotate_group_key(&self, group_id: GroupId) -> Result<()>

执行群组密钥更新(前向保密性)

Source

pub fn encrypt_group_message( &self, group_id: GroupId, payload: &MessagePayload, ) -> Result<MessagePayload>

Source

pub fn decrypt_group_message( &self, group_id: GroupId, encrypted_payload: &MessagePayload, ) -> Result<MessagePayload>

Source

pub async fn handle_key_update( &self, group_id: GroupId, epoch: u64, _update_path: Vec<u8>, ) -> Result<()>

处理群组密钥更新

Source

pub async fn handle_ack(&self, original_msg_id: Uuid, responder: DeviceId)

处理ACK消息

Source

pub async fn cleanup_expired_broadcast_results(&self)

清理过期的广播结果通道,防止内存泄漏

Source

pub fn cleanup_expired_invites(&self, max_age_hours: u64)

清理过期的邀请记录,防止内存泄漏

Source

pub async fn update_member_state( &self, group_id: GroupId, device_id: DeviceId, status: MemberStatus, ) -> Result<()>

更新群组成员状态

Source

pub async fn notify_group_state_change(&self, group_id: GroupId)

通知群组状态变更

Source

pub async fn broadcast_large_group( &self, group_id: GroupId, payload: MessagePayload, ) -> Result<Vec<Uuid>>

大规模群组性能优化 - 分层广播

Source

pub async fn handle_incoming_group_message( &self, message: &Message, ) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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