pub struct Server { /* private fields */ }Available on crate feature
async only.Expand description
A ttrpc Server (async).
Implementations§
Source§impl Server
impl Server
pub fn new() -> Server
pub fn bind(self, sockaddr: &str) -> Result<Self>
pub fn add_listener(self, listener: Listener) -> Server
Sourcepub unsafe fn add_unix_listener(self, fd: RawFd) -> Result<Server>
Available on Unix only.
pub unsafe fn add_unix_listener(self, fd: RawFd) -> Result<Server>
§Safety
The file descriptor must represent a unix listener.
Sourcepub unsafe fn add_tcp_listener(self, fd: RawFd) -> Result<Server>
Available on Unix only.
pub unsafe fn add_tcp_listener(self, fd: RawFd) -> Result<Server>
§Safety
The file descriptor must represent a unix listener.
Sourcepub unsafe fn add_vsock_listener(self, fd: RawFd) -> Result<Self>
Available on Linux or Android only.
pub unsafe fn add_vsock_listener(self, fd: RawFd) -> Result<Self>
§Safety
The file descriptor must represent a vsock listener.
pub fn register_service(self, new: HashMap<String, Service>) -> Server
pub async fn start(&mut self) -> Result<()>
pub async fn shutdown(&mut self) -> Result<()>
pub async fn disconnect(&mut self)
pub async fn stop_listen(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl !Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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