pub struct LinksServer { /* private fields */ }Expand description
A bound, not yet serving, LiNo server.
Implementations§
Source§impl LinksServer
impl LinksServer
Sourcepub fn bind(
address: impl ToSocketAddrs,
options: ServerOptions,
) -> ProtocolResult<Self>
pub fn bind( address: impl ToSocketAddrs, options: ServerOptions, ) -> ProtocolResult<Self>
Binds to address (use port 0 for an ephemeral port).
Sourcepub fn with_readable(
self,
readable: impl Fn(&Link) -> bool + Send + 'static,
) -> Self
pub fn with_readable( self, readable: impl Fn(&Link) -> bool + Send + 'static, ) -> Self
Lets subscribers see only the links readable accepts; without it,
every subscriber sees every link.
A side of a change the subscriber may not read is left out of its push, so a link that becomes unreadable arrives as a deletion and one that becomes readable as a creation. This is where a permission layer plugs in.
Sourcepub fn local_addr(&self) -> ProtocolResult<SocketAddr>
pub fn local_addr(&self) -> ProtocolResult<SocketAddr>
The address the server listens on.
Sourcepub fn shutdown_handle(&self) -> ProtocolResult<ShutdownHandle>
pub fn shutdown_handle(&self) -> ProtocolResult<ShutdownHandle>
A handle that stops serve.
Sourcepub fn serve<S: NamedTypeLinks>(self, storage: &mut S) -> ProtocolResult<()>
pub fn serve<S: NamedTypeLinks>(self, storage: &mut S) -> ProtocolResult<()>
Serves storage until a ShutdownHandle stops the server.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LinksServer
impl !Sync for LinksServer
impl !UnwindSafe for LinksServer
impl Freeze for LinksServer
impl Send for LinksServer
impl Unpin for LinksServer
impl UnsafeUnpin for LinksServer
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