pub struct WebSocket { /* private fields */ }Expand description
WebSocket represents a WebSocket connection in the page.
Implementations§
Source§impl WebSocket
impl WebSocket
Sourcepub fn new(
parent: Arc<dyn ChannelOwner>,
type_name: String,
guid: Arc<str>,
initializer: Value,
) -> Result<Self>
pub fn new( parent: Arc<dyn ChannelOwner>, type_name: String, guid: Arc<str>, initializer: Value, ) -> Result<Self>
Creates a new WebSocket object
Sourcepub async fn on_frame_sent<F>(&self, handler: F) -> Result<()>
pub async fn on_frame_sent<F>(&self, handler: F) -> Result<()>
Adds a listener for FrameSent events.
Sourcepub async fn on_frame_received<F>(&self, handler: F) -> Result<()>
pub async fn on_frame_received<F>(&self, handler: F) -> Result<()>
Adds a listener for FrameReceived events.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebSocket
impl !RefUnwindSafe for WebSocket
impl Send for WebSocket
impl Sync for WebSocket
impl Unpin for WebSocket
impl UnsafeUnpin for WebSocket
impl !UnwindSafe for WebSocket
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