pub struct RealtimeChannelBuilder { /* private fields */ }Expand description
Builder struct for [RealtimeChannel]
Implementations§
Source§impl RealtimeChannelBuilder
impl RealtimeChannelBuilder
Sourcepub fn broadcast(self, broadcast_config: BroadcastConfig) -> Self
pub fn broadcast(self, broadcast_config: BroadcastConfig) -> Self
Set the broadcast config for this channel
Sourcepub fn presence(self, presence_config: PresenceConfig) -> Self
pub fn presence(self, presence_config: PresenceConfig) -> Self
Set the presence config for this channel
Sourcepub fn on_postgres_change(
self,
event: PostgresChangesEvent,
filter: PostgresChangeFilter,
callback: impl FnMut(&PostgresChangesPayload) + 'static + Send,
) -> Self
pub fn on_postgres_change( self, event: PostgresChangesEvent, filter: PostgresChangeFilter, callback: impl FnMut(&PostgresChangesPayload) + 'static + Send, ) -> Self
Add a postgres changes callback to this channel
Sourcepub fn on_presence(
self,
event: PresenceEvent,
callback: impl Fn(String, PresenceState, PresenceState) + Send + 'static,
) -> Self
pub fn on_presence( self, event: PresenceEvent, callback: impl Fn(String, PresenceState, PresenceState) + Send + 'static, ) -> Self
Add a presence callback to this channel
Sourcepub fn on_broadcast(
self,
event: impl Into<String>,
callback: impl FnMut(&HashMap<String, Value>) + 'static + Send,
) -> Self
pub fn on_broadcast( self, event: impl Into<String>, callback: impl FnMut(&HashMap<String, Value>) + 'static + Send, ) -> Self
Add a broadcast callback to this channel
Sourcepub fn build_sync(
self,
client: &ClientManagerSync,
) -> Result<ChannelManagerSync, RecvError>
pub fn build_sync( self, client: &ClientManagerSync, ) -> Result<ChannelManagerSync, RecvError>
Consume self and return a new ChannelManagerSync that controls the newly created channel Automatically assigns the new channel in the client.
For async applications you may want self::build()
Sourcepub async fn build(
self,
client: &ClientManager,
) -> Result<ChannelManager, RecvError>
pub async fn build( self, client: &ClientManager, ) -> Result<ChannelManager, RecvError>
Consume self and return a new ChannelManager that controls the newly created channel Automatically assigns the new channel in the client.
For sync applications you may want self::build_sync()
Auto Trait Implementations§
impl Freeze for RealtimeChannelBuilder
impl !RefUnwindSafe for RealtimeChannelBuilder
impl Send for RealtimeChannelBuilder
impl !Sync for RealtimeChannelBuilder
impl Unpin for RealtimeChannelBuilder
impl !UnwindSafe for RealtimeChannelBuilder
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