pub struct Realtime { /* private fields */ }
Expand description
Realtime client for WebSocket subscriptions
Implementations§
Source§impl Realtime
impl Realtime
Sourcepub fn new(config: Arc<SupabaseConfig>) -> Result<Self>
pub fn new(config: Arc<SupabaseConfig>) -> Result<Self>
Create a new Realtime instance
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from the realtime WebSocket
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connected
Sourcepub fn channel(&self, topic: &str) -> SubscriptionBuilder
pub fn channel(&self, topic: &str) -> SubscriptionBuilder
Create a new subscription builder
Sourcepub async fn subscribe<F>(
&self,
config: SubscriptionConfig,
callback: F,
) -> Result<String>
pub async fn subscribe<F>( &self, config: SubscriptionConfig, callback: F, ) -> Result<String>
Subscribe to table changes
Sourcepub async fn unsubscribe(&self, subscription_id: &str) -> Result<()>
pub async fn unsubscribe(&self, subscription_id: &str) -> Result<()>
Unsubscribe from a topic
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Realtime
impl !RefUnwindSafe for Realtime
impl Send for Realtime
impl Sync for Realtime
impl Unpin for Realtime
impl !UnwindSafe for Realtime
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