pub struct EchoManager { /* private fields */ }Implementations§
Source§impl EchoManager
impl EchoManager
pub fn new() -> EchoManager
Sourcepub fn add_connection(&self, id: Uuid, tx: UnboundedSender<EchoMessage>)
pub fn add_connection(&self, id: Uuid, tx: UnboundedSender<EchoMessage>)
Mendaftarkan koneksi baru.
Sourcepub fn remove_connection(&self, id: &Uuid)
pub fn remove_connection(&self, id: &Uuid)
Menghapus koneksi saat terputus.
Sourcepub fn unsubscribe(&self, id: &Uuid, channel: &str)
pub fn unsubscribe(&self, id: &Uuid, channel: &str)
Unsubscribe koneksi dari channel tertentu.
Sourcepub fn broadcast_local(&self, channel: &str, event: &str, data: Value)
pub fn broadcast_local(&self, channel: &str, event: &str, data: Value)
Kirim pesan hanya ke subscriber lokal pada instance server ini.
Sourcepub fn broadcast(&self, channel: &str, event: &str, data: Value)
pub fn broadcast(&self, channel: &str, event: &str, data: Value)
Kirim pesan ke semua subscriber di channel tertentu (lokal dan klaster Redis multi-pod).
Mendaftarkan closure otorisasi untuk channel pattern (misal “private-user-{id}”)
Verifikasi apakah koneksi/request diperbolehkan masuk ke channel tertentu.
Sourcepub fn authenticate_channel(
&self,
req: &ChannelAuthRequest,
) -> ChannelAuthResponse
pub fn authenticate_channel( &self, req: &ChannelAuthRequest, ) -> ChannelAuthResponse
Menangani otorisasi request dari client
Auto Trait Implementations§
impl !Freeze for EchoManager
impl Forget for EchoManager
impl Move for EchoManager
impl RefUnwindSafe for EchoManager
impl Send for EchoManager
impl Sync for EchoManager
impl Unpin for EchoManager
impl UnsafeUnpin for EchoManager
impl UnwindSafe for EchoManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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 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> ⓘ
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