pub struct WebSocketClient { /* private fields */ }Expand description
WebSocket client.
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub fn with_config(config: ClientConfig) -> Self
pub fn with_config(config: ClientConfig) -> Self
Create a new client with custom configuration.
Sourcepub async fn subscribe_tiles(
&mut self,
bbox: [f64; 4],
zoom_range: Range<u8>,
) -> Result<String>
pub async fn subscribe_tiles( &mut self, bbox: [f64; 4], zoom_range: Range<u8>, ) -> Result<String>
Subscribe to tile updates.
Sourcepub async fn subscribe_features(
&mut self,
layer: Option<String>,
) -> Result<String>
pub async fn subscribe_features( &mut self, layer: Option<String>, ) -> Result<String>
Subscribe to feature updates.
Sourcepub async fn subscribe_events(
&mut self,
event_types: Vec<EventType>,
) -> Result<String>
pub async fn subscribe_events( &mut self, event_types: Vec<EventType>, ) -> Result<String>
Subscribe to events.
Sourcepub async fn unsubscribe(&mut self, subscription_id: &str) -> Result<()>
pub async fn unsubscribe(&mut self, subscription_id: &str) -> Result<()>
Unsubscribe from updates.
Sourcepub fn message_stream(&mut self) -> Option<MessageStream>
pub fn message_stream(&mut self) -> Option<MessageStream>
Get a stream of all messages.
Sourcepub fn tile_stream(&mut self) -> TileStream
pub fn tile_stream(&mut self) -> TileStream
Get a stream of tile data.
Sourcepub fn feature_stream(&mut self) -> FeatureStream
pub fn feature_stream(&mut self) -> FeatureStream
Get a stream of feature data.
Sourcepub fn event_stream(&mut self) -> EventStream
pub fn event_stream(&mut self) -> EventStream
Get a stream of events.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebSocketClient
impl !RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnsafeUnpin for WebSocketClient
impl !UnwindSafe for WebSocketClient
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