Struct deno_websocket::WsStreamResource
source · [−]pub struct WsStreamResource {
pub stream: WebSocketStreamType,
pub cancel: CancelHandle,
}
Fields
stream: WebSocketStreamType
cancel: CancelHandle
Trait Implementations
sourceimpl Resource for WsStreamResource
impl Resource for WsStreamResource
sourcefn name(&self) -> Cow<'_, str>
fn name(&self) -> Cow<'_, str>
Returns a string representation of the resource which is made available
to JavaScript code through op_resources
. The default implementation
returns the Rust type name, but specific resource types may override this
trait method. Read more
sourcefn read(
self: Rc<Self>,
buf: ZeroCopyBuf
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'static, Global>>
fn read(
self: Rc<Self>,
buf: ZeroCopyBuf
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'static, Global>>
Resources may implement read()
to be a readable stream
fn read_return(
self: Rc<Self>,
_buf: ZeroCopyBuf
) -> Pin<Box<dyn Future<Output = Result<(usize, ZeroCopyBuf), Error>> + 'static, Global>>
sourcefn write(
self: Rc<Self>,
_buf: ZeroCopyBuf
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'static, Global>>
fn write(
self: Rc<Self>,
_buf: ZeroCopyBuf
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'static, Global>>
Resources may implement write()
to be a writable stream
Auto Trait Implementations
impl !RefUnwindSafe for WsStreamResource
impl !Send for WsStreamResource
impl !Sync for WsStreamResource
impl !Unpin for WsStreamResource
impl !UnwindSafe for WsStreamResource
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more