pub struct HttpReplicationServer { /* private fields */ }Expand description
HTTP replication server wrapping an Arc<Mutex<Engine>>.
Call start(bind_addr) to spawn the server loop in a background thread.
Implementations§
Source§impl HttpReplicationServer
impl HttpReplicationServer
Sourcepub fn new(engine: Arc<Mutex<Engine>>) -> Self
pub fn new(engine: Arc<Mutex<Engine>>) -> Self
Create a new server wrapping the provided engine.
Sourcepub fn start(
&self,
bind_addr: &str,
) -> Result<(JoinHandle<()>, u16), EdgestoreError>
pub fn start( &self, bind_addr: &str, ) -> Result<(JoinHandle<()>, u16), EdgestoreError>
Bind to bind_addr and start the request loop in a background thread.
Returns (JoinHandle, bound_port). The bound port is useful when bind_addr
uses port 0 (OS-assigned ephemeral port). The server runs until the process exits.
Auto Trait Implementations§
impl Freeze for HttpReplicationServer
impl RefUnwindSafe for HttpReplicationServer
impl Send for HttpReplicationServer
impl Sync for HttpReplicationServer
impl Unpin for HttpReplicationServer
impl UnsafeUnpin for HttpReplicationServer
impl UnwindSafe for HttpReplicationServer
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