pub trait SocketExt: 'static {
Show 54 methods
fn accept(
&self,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<Socket, Error>;
fn bind(
&self,
address: &impl IsA<SocketAddress>,
allow_reuse: bool
) -> Result<(), Error>;
fn check_connect_result(&self) -> Result<(), Error>;
fn close(&self) -> Result<(), Error>;
fn condition_check(&self, condition: IOCondition) -> IOCondition;
fn condition_timed_wait(
&self,
condition: IOCondition,
timeout_us: i64,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>;
fn condition_wait(
&self,
condition: IOCondition,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>;
fn connect(
&self,
address: &impl IsA<SocketAddress>,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>;
fn connection_factory_create_connection(&self) -> SocketConnection;
fn available_bytes(&self) -> isize;
fn is_blocking(&self) -> bool;
fn is_broadcast(&self) -> bool;
fn credentials(&self) -> Result<Credentials, Error>;
fn family(&self) -> SocketFamily;
fn is_keepalive(&self) -> bool;
fn listen_backlog(&self) -> i32;
fn local_address(&self) -> Result<SocketAddress, Error>;
fn is_multicast_loopback(&self) -> bool;
fn multicast_ttl(&self) -> u32;
fn option(&self, level: i32, optname: i32) -> Result<i32, Error>;
fn protocol(&self) -> SocketProtocol;
fn remote_address(&self) -> Result<SocketAddress, Error>;
fn socket_type(&self) -> SocketType;
fn timeout(&self) -> u32;
fn ttl(&self) -> u32;
fn is_closed(&self) -> bool;
fn is_connected(&self) -> bool;
fn join_multicast_group(
&self,
group: &impl IsA<InetAddress>,
source_specific: bool,
iface: Option<&str>
) -> Result<(), Error>;
fn join_multicast_group_ssm(
&self,
group: &impl IsA<InetAddress>,
source_specific: Option<&impl IsA<InetAddress>>,
iface: Option<&str>
) -> Result<(), Error>;
fn leave_multicast_group(
&self,
group: &impl IsA<InetAddress>,
source_specific: bool,
iface: Option<&str>
) -> Result<(), Error>;
fn leave_multicast_group_ssm(
&self,
group: &impl IsA<InetAddress>,
source_specific: Option<&impl IsA<InetAddress>>,
iface: Option<&str>
) -> Result<(), Error>;
fn listen(&self) -> Result<(), Error>;
fn set_blocking(&self, blocking: bool);
fn set_broadcast(&self, broadcast: bool);
fn set_keepalive(&self, keepalive: bool);
fn set_listen_backlog(&self, backlog: i32);
fn set_multicast_loopback(&self, loopback: bool);
fn set_multicast_ttl(&self, ttl: u32);
fn set_option(&self, level: i32, optname: i32, value: i32) -> Result<(), Error>;
fn set_timeout(&self, timeout: u32);
fn set_ttl(&self, ttl: u32);
fn shutdown(
&self,
shutdown_read: bool,
shutdown_write: bool
) -> Result<(), Error>;
fn speaks_ipv4(&self) -> bool;
fn type_(&self) -> SocketType;
fn connect_blocking_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_broadcast_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_keepalive_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_listen_backlog_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_local_address_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_multicast_loopback_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_multicast_ttl_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_remote_address_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_timeout_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_ttl_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
Required Methods
source
fn check_connect_result(&self) -> Result<(), Error>
source
fn condition_check(&self, condition: IOCondition) -> IOCondition
sourcefn condition_timed_wait(
fn condition_timed_wait(
&self,
condition: IOCondition,
timeout_us: i64,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>
sourcefn condition_wait(
fn condition_wait(
&self,
condition: IOCondition,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>
sourcefn connect(
fn connect(
&self,
address: &impl IsA<SocketAddress>,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>
source
fn available_bytes(&self) -> isize
source
fn is_blocking(&self) -> bool
source
fn is_broadcast(&self) -> bool
source
fn credentials(&self) -> Result<Credentials, Error>
source
fn family(&self) -> SocketFamily
source
fn is_keepalive(&self) -> bool
source
fn listen_backlog(&self) -> i32
source
fn local_address(&self) -> Result<SocketAddress, Error>
source
fn is_multicast_loopback(&self) -> bool
source
fn multicast_ttl(&self) -> u32
source
fn protocol(&self) -> SocketProtocol
source
fn remote_address(&self) -> Result<SocketAddress, Error>
source
fn socket_type(&self) -> SocketType
source
fn is_connected(&self) -> bool
sourcefn join_multicast_group(
fn join_multicast_group(
&self,
group: &impl IsA<InetAddress>,
source_specific: bool,
iface: Option<&str>
) -> Result<(), Error>
sourcefn join_multicast_group_ssm(
fn join_multicast_group_ssm(
&self,
group: &impl IsA<InetAddress>,
source_specific: Option<&impl IsA<InetAddress>>,
iface: Option<&str>
) -> Result<(), Error>
sourcefn leave_multicast_group(
fn leave_multicast_group(
&self,
group: &impl IsA<InetAddress>,
source_specific: bool,
iface: Option<&str>
) -> Result<(), Error>
sourcefn leave_multicast_group_ssm(
fn leave_multicast_group_ssm(
&self,
group: &impl IsA<InetAddress>,
source_specific: Option<&impl IsA<InetAddress>>,
iface: Option<&str>
) -> Result<(), Error>
source
fn set_blocking(&self, blocking: bool)
source
fn set_broadcast(&self, broadcast: bool)
source
fn set_keepalive(&self, keepalive: bool)
source
fn set_listen_backlog(&self, backlog: i32)
source
fn set_multicast_loopback(&self, loopback: bool)
source
fn set_multicast_ttl(&self, ttl: u32)
source
fn set_timeout(&self, timeout: u32)
source
fn speaks_ipv4(&self) -> bool
source
fn type_(&self) -> SocketType
sourcefn connect_blocking_notify<F: Fn(&Self) + 'static>(
fn connect_blocking_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_broadcast_notify<F: Fn(&Self) + 'static>(
fn connect_broadcast_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_keepalive_notify<F: Fn(&Self) + 'static>(
fn connect_keepalive_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_listen_backlog_notify<F: Fn(&Self) + 'static>(
fn connect_listen_backlog_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_local_address_notify<F: Fn(&Self) + 'static>(
fn connect_local_address_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_multicast_loopback_notify<F: Fn(&Self) + 'static>(
fn connect_multicast_loopback_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_multicast_ttl_notify<F: Fn(&Self) + 'static>(
fn connect_multicast_ttl_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_remote_address_notify<F: Fn(&Self) + 'static>(
fn connect_remote_address_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
source
fn connect_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
source