pub struct Server<R> { /* private fields */ }Expand description
The ticket’s server: one rail, one session and its service subscriptions.
Implementations§
Source§impl<R: Rail> Server<R>
impl<R: Rail> Server<R>
Sourcepub fn serve<I: BufRead, O: Write + Send>(
&mut self,
input: &mut I,
output: &mut O,
) -> Result<()>
pub fn serve<I: BufRead, O: Write + Send>( &mut self, input: &mut I, output: &mut O, ) -> Result<()>
Serves requests while tap readers send unsolicited logging lines. EOF signals and joins every receiver before this returns.
§Errors
Returns the input, output, framing or subscription-teardown failure.
Source§impl<R: Rail> Server<R>
impl<R: Rail> Server<R>
Sourcepub fn new(rail: R, frame_bytes: usize) -> Self
pub fn new(rail: R, frame_bytes: usize) -> Self
A server over rail, reading lines of at most frame_bytes.
Sourcepub fn configured(rail: R, config: &Config) -> Result<Self, String>
pub fn configured(rail: R, config: &Config) -> Result<Self, String>
A ticket on the validated seat, with initial listens opened by serve.
No socket or pass request occurs in this constructor.
§Errors
Returns a named pass-source or listen-configuration refusal.
Sourcepub fn listen_counts(&self) -> Result<(usize, usize), String>
pub fn listen_counts(&self) -> Result<(usize, usize), String>
Active channel subjects and all ticket channel threads, respectively. Each subject owns two streams, a tap reader and a join worker.
§Errors
Returns a poisoned listen-state lock.
Trait Implementations§
Auto Trait Implementations§
impl<R> !Freeze for Server<R>
impl<R> !RefUnwindSafe for Server<R>
impl<R> !UnwindSafe for Server<R>
impl<R> Send for Server<R>where
R: Send,
impl<R> Sync for Server<R>where
R: Sync,
impl<R> Unpin for Server<R>where
R: Unpin,
impl<R> UnsafeUnpin for Server<R>where
R: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.