pub struct NetworkRestoreServer { /* private fields */ }Expand description
Serves log files to nodes performing a network restore.
Implements both standalone TCP serving and the ServiceHandler trait so
it can be plugged into a TcpServiceDispatcher.
Implementations§
Source§impl NetworkRestoreServer
impl NetworkRestoreServer
Sourcepub fn new(env_home: impl Into<PathBuf>) -> Self
pub fn new(env_home: impl Into<PathBuf>) -> Self
Create a new restore server that will serve files from env_home.
Sourcepub fn into_arc(self) -> Arc<Self> ⓘ
pub fn into_arc(self) -> Arc<Self> ⓘ
Wrap in Arc so the same instance can be shared between the accept
loop thread and the ServiceHandler registration.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the standalone accept loop is running.
Sourcepub fn start(self: &Arc<Self>, addr: SocketAddr) -> Result<SocketAddr>
pub fn start(self: &Arc<Self>, addr: SocketAddr) -> Result<SocketAddr>
Start a dedicated TCP accept loop on addr.
Returns the actual bound address (useful when addr has port 0).
Connections are handled in per-connection threads.
Trait Implementations§
Source§impl ServiceHandler for NetworkRestoreServer
NetworkRestoreServer can be registered with TcpServiceDispatcher under
the "RESTORE" service name. The service dispatcher reads the service name
from each new connection before calling handle(); the channel passed here
is ready for the RESTORE protocol (magic bytes onward).
impl ServiceHandler for NetworkRestoreServer
NetworkRestoreServer can be registered with TcpServiceDispatcher under
the "RESTORE" service name. The service dispatcher reads the service name
from each new connection before calling handle(); the channel passed here
is ready for the RESTORE protocol (magic bytes onward).
Auto Trait Implementations§
impl Freeze for NetworkRestoreServer
impl RefUnwindSafe for NetworkRestoreServer
impl Send for NetworkRestoreServer
impl Sync for NetworkRestoreServer
impl Unpin for NetworkRestoreServer
impl UnsafeUnpin for NetworkRestoreServer
impl UnwindSafe for NetworkRestoreServer
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> 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