pub struct Acceptor<const PREVIEW: bool = false> { /* private fields */ }
Implementations§
Source§impl Acceptor<false>
impl Acceptor<false>
pub fn new(target: ResolvedTarget) -> Self
pub fn new_tls( target: ResolvedTarget, provider: TlsServerParameterProvider, ) -> Self
pub fn new_starttls( target: ResolvedTarget, provider: TlsServerParameterProvider, ) -> Self
pub fn new_tcp(addr: SocketAddr) -> Self
pub fn new_tcp_tls( addr: SocketAddr, provider: TlsServerParameterProvider, ) -> Self
pub fn new_tcp_starttls( addr: SocketAddr, provider: TlsServerParameterProvider, ) -> Self
pub fn new_unix_path(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn new_unix_domain(domain: impl AsRef<[u8]>) -> Result<Self, Error>
pub async fn bind( self, ) -> Result<impl Stream<Item = Result<UpgradableStream<BaseStream, Ssl>, ConnectionError>> + LocalAddress, ConnectionError>
pub async fn bind_explicit<D: TlsDriver>( self, ) -> Result<impl Stream<Item = Result<UpgradableStream<BaseStream, D>, ConnectionError>> + LocalAddress, ConnectionError>
Sourcepub async fn accept_one(
self,
) -> Result<UpgradableStream<BaseStream, Ssl>, ConnectionError>
pub async fn accept_one( self, ) -> Result<UpgradableStream<BaseStream, Ssl>, ConnectionError>
Listen, and then accept one and only one connection from the listener.
Source§impl Acceptor<true>
impl Acceptor<true>
Sourcepub fn new_tcp_tls_previewing(
addr: SocketAddr,
preview_configuration: PreviewConfiguration,
provider: TlsServerParameterProvider,
) -> Self
pub fn new_tcp_tls_previewing( addr: SocketAddr, preview_configuration: PreviewConfiguration, provider: TlsServerParameterProvider, ) -> Self
Create a new TCP/TLS acceptor that will preview the first
PreviewConfiguration::max_preview_bytes
bytes of the connection.
Sourcepub fn new_tls_previewing(
addr: ResolvedTarget,
preview_configuration: PreviewConfiguration,
provider: TlsServerParameterProvider,
) -> Self
pub fn new_tls_previewing( addr: ResolvedTarget, preview_configuration: PreviewConfiguration, provider: TlsServerParameterProvider, ) -> Self
Create a new acceptor that will preview the first
PreviewConfiguration::max_preview_bytes
bytes of the connection.
Sourcepub fn new_previewing(
addr: ResolvedTarget,
preview_configuration: PreviewConfiguration,
) -> Self
pub fn new_previewing( addr: ResolvedTarget, preview_configuration: PreviewConfiguration, ) -> Self
Create a new acceptor that will preview the first
PreviewConfiguration::max_preview_bytes
bytes of the connection.
pub async fn bind( self, ) -> Result<impl Stream<Item = Result<(Preview, UpgradableStream<BaseStream, Ssl>), ConnectionError>> + LocalAddress, ConnectionError>
pub async fn bind_explicit<D: TlsDriver>( self, ) -> Result<impl Stream<Item = Result<(Preview, UpgradableStream<BaseStream, D>), ConnectionError>> + LocalAddress, ConnectionError>
Sourcepub async fn accept_one(
self,
) -> Result<(Preview, UpgradableStream<BaseStream, Ssl>), ConnectionError>
pub async fn accept_one( self, ) -> Result<(Preview, UpgradableStream<BaseStream, Ssl>), ConnectionError>
Listen, and then accept one and only one connection from the listener.
Auto Trait Implementations§
impl<const PREVIEW: bool> Freeze for Acceptor<PREVIEW>
impl<const PREVIEW: bool = false> !RefUnwindSafe for Acceptor<PREVIEW>
impl<const PREVIEW: bool> Send for Acceptor<PREVIEW>
impl<const PREVIEW: bool> Sync for Acceptor<PREVIEW>
impl<const PREVIEW: bool> Unpin for Acceptor<PREVIEW>
impl<const PREVIEW: bool = false> !UnwindSafe for Acceptor<PREVIEW>
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