pub struct Socket { /* private fields */ }
Expand description
Defines the raw Socket type. This type should never be interacted with directly, except to create new instances of wrapper types.
Implementations§
source§impl Socket
impl Socket
sourcepub fn builder<T>(ctx: Arc<Context>) -> SocketBuilder<'static, T>
pub fn builder<T>(ctx: Arc<Context>) -> SocketBuilder<'static, T>
Start a new Socket Config builder
sourcepub fn inner(self) -> (Socket, EventedFile)
pub fn inner(self) -> (Socket, EventedFile)
Retrieve a Reference-Counted Pointer to self’s socket.
sourcepub fn from_sock_and_file(sock: Socket, file: EventedFile) -> Self
pub fn from_sock_and_file(sock: Socket, file: EventedFile) -> Self
Create a new socket from a given Sock and File
This assumes that sock
is already configured properly. Please don’t call this directly
unless you know what you’re doing.
sourcepub fn sink(self, buffer_size: usize) -> MultipartSink
pub fn sink(self, buffer_size: usize) -> MultipartSink
Retrieve a Sink that consumes Multiparts, sending them to the socket
sourcepub fn stream(self) -> MultipartStream
pub fn stream(self) -> MultipartStream
Retrieve a Stream that produces Multiparts, getting them from the socket
sourcepub fn sink_stream(self, buffer_size: usize) -> MultipartSinkStream
pub fn sink_stream(self, buffer_size: usize) -> MultipartSinkStream
Retrieve a structure that is both a Stream that produces Multiparts and a Sink that consumes Multiparts.
sourcepub fn send<T>(self, multipart: Multipart) -> MultipartRequest<T>where
T: From<(Socket, EventedFile)>,
pub fn send<T>(self, multipart: Multipart) -> MultipartRequest<T>where
T: From<(Socket, EventedFile)>,
Retrieve a Future that consumes a multipart, sending it to the socket
sourcepub fn recv<T>(self) -> MultipartResponse<T>where
T: From<(Socket, EventedFile)>,
pub fn recv<T>(self) -> MultipartResponse<T>where
T: From<(Socket, EventedFile)>,
Retrieve a Future that produces a multipart, getting it fromthe socket