Struct easyfibers::Fiber [] [src]

pub struct Fiber<P, R> { /* fields omitted */ }

Available within the fiber execute function to configure fiber or create child fibers. Child fibers return results to parent fibers instead of poller on main stack.

Methods

impl<P, R> Fiber<P, R>
[src]

How long to wait on socket operations before timing out. You probably want to set something.

Return intermediate result. A fiber can stream responses to poller or to its parent fiber.

This function blocks fiber until response is received to poller or parent.

Accept TCP socket. Works only on fibers from TcpListener.

Convert fiber from TcpStream created with TcpStream::connect to TlsStream.

Convert fiber from TcpStream created with TcpListener::accept to TlsStream.

Start fiber on TCP socket.

This function does not block and fiber gets executed on next poll(). There is no relationship between calling and created fiber.

Start fiber on TCP listener.

This function does not block and fiber gets executed on next poll(). There is no relationship between calling and created fiber.

Start fiber on UDP socket.

This function does not block and fiber gets executed on next poll(). There is no relationship between calling and created fiber.

Resolve domain, connect and run fiber. In case domain resolve or connect fails, fiber will still be run but all socket operations will fail.

This function does not block, host lookup starts immediately. There is no relationship between calling and created fiber.

Start a child fiber with tcp socket.

This function does not block current fiber.

Start a child fiber with an udp socket.

This function does not block current fiber.

Start a child fiber that resolves domain, connects and runs fiber. In case domain resolve or connect fails, fiber will still be run but all socket operations will fail.

This function does not block, host lookup starts immediately.

Call main stack.

This function blocks until main stack produces response.

Get result of child. If fiber has multiple children it will return first available result. Will block current fiber if nothing available immediately.

If none is returned all children have finished executing.

Remove stack from current fiber and reuse on other connections. Once socket becomes signalled for reads, resume from the start of FiberFn.

Trait Implementations

impl<P: PartialEq, R: PartialEq> PartialEq for Fiber<P, R>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<P: Debug, R: Debug> Debug for Fiber<P, R>
[src]

Formats the value using the given formatter.

impl<P, R> Read for Fiber<P, R>
[src]

Read data from socket. If no data is available to read, fiber will be scheduled out for another one, until there is data available.

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl<'a, P, R> Read for &'a Fiber<P, R>
[src]

Read data from socket. If no data is available to read, fiber will be scheduled out for another one, until there is data available.

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl<P, R> Write for Fiber<P, R>
[src]

Write data to socket. If data can not be written at this time, fiber will be scheduled out for another one until there is data available.

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more