Trait script::dom::bindings::codegen::Bindings::WebSocketBinding::WebSocket_Binding::WebSocketMethods
source · pub trait WebSocketMethods<D: DomTypes> {
Show 20 methods
// Required methods
fn Url(&self) -> DOMString;
fn ReadyState(&self) -> u16;
fn BufferedAmount(&self) -> u64;
fn GetOnopen(&self) -> Option<Rc<EventHandlerNonNull>>;
fn SetOnopen(&self, value: Option<Rc<EventHandlerNonNull>>);
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull>>;
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull>>);
fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull>>;
fn SetOnclose(&self, value: Option<Rc<EventHandlerNonNull>>);
fn Protocol(&self) -> DOMString;
fn Close(
&self,
code: Option<u16>,
reason: Option<USVString>,
) -> Result<(), Error>;
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull>>;
fn SetOnmessage(&self, value: Option<Rc<EventHandlerNonNull>>);
fn BinaryType(&self) -> BinaryType;
fn SetBinaryType(&self, value: BinaryType);
fn Send(&self, data: USVString) -> Result<(), Error>;
fn Send_(&self, data: &Blob) -> Result<(), Error>;
fn Send__(
&self,
data: CustomAutoRooterGuard<'_, ArrayBuffer>,
) -> Result<(), Error>;
fn Send___(
&self,
data: CustomAutoRooterGuard<'_, ArrayBufferView>,
) -> Result<(), Error>;
fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
url: DOMString,
protocols: Option<StringOrStringSequence>,
) -> Result<Root<Dom<WebSocket>>, Error>;
}
Required Methods§
fn Url(&self) -> DOMString
fn ReadyState(&self) -> u16
fn BufferedAmount(&self) -> u64
fn GetOnopen(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnopen(&self, value: Option<Rc<EventHandlerNonNull>>)
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull>>)
fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnclose(&self, value: Option<Rc<EventHandlerNonNull>>)
fn Protocol(&self) -> DOMString
fn Close( &self, code: Option<u16>, reason: Option<USVString>, ) -> Result<(), Error>
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmessage(&self, value: Option<Rc<EventHandlerNonNull>>)
fn BinaryType(&self) -> BinaryType
fn SetBinaryType(&self, value: BinaryType)
fn Send(&self, data: USVString) -> Result<(), Error>
fn Send_(&self, data: &Blob) -> Result<(), Error>
fn Send__( &self, data: CustomAutoRooterGuard<'_, ArrayBuffer>, ) -> Result<(), Error>
fn Send___( &self, data: CustomAutoRooterGuard<'_, ArrayBufferView>, ) -> Result<(), Error>
fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, url: DOMString, protocols: Option<StringOrStringSequence>, ) -> Result<Root<Dom<WebSocket>>, Error>
Object Safety§
This trait is not object safe.