pub struct Listener { /* private fields */ }Expand description
A way back listened for on this machine’s loopback, not yet served.
Implementations§
Source§impl Listener
impl Listener
Sourcepub fn bind(back: &Return) -> Result<Self, NotListening>
pub fn bind(back: &Return) -> Result<Self, NotListening>
Listens for back on this machine: on 127.0.0.1, [::1] or both, as it names.
A machine with no IPv6 at all is not a reason to refuse a localhost way back, since the
browser there has no [::1] to try either; a program of someone else’s on [::1] is.
§Errors
When the port is taken, or the system refuses to listen on it.
Sourcepub fn serve(
self,
carrier: &EngineCommand,
wait: impl FnMut(Duration) -> bool,
) -> Ending
pub fn serve( self, carrier: &EngineCommand, wait: impl FnMut(Duration) -> bool, ) -> Ending
Carries every connection that arrives to the application with carrier, each on a thread
of its own, until the sign-in has come back, wait says to stop, or WAIT has passed.
wait sleeps for the time it is given and answers whether to go on; the time is counted in
those sleeps, so a clock of a test’s own decides when the wait is over. The port is given
up when this returns; connections still being carried are finished by their threads.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Listener
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin for Listener
impl UnsafeUnpin for Listener
impl UnwindSafe for Listener
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more