Struct gio::SocketClient
source · #[repr(transparent)]pub struct SocketClient { /* private fields */ }
Expand description
SocketClient
is a lightweight high-level utility class for connecting to
a network host using a connection oriented socket type.
You create a SocketClient
object, set any options you want, and then
call a sync or async connect operation, which returns a SocketConnection
subclass on success.
The type of the SocketConnection
object returned depends on the type of
the underlying socket that is in use. For instance, for a TCP/IP connection
it will be a TcpConnection
.
As SocketClient
is a lightweight object, you don’t need to cache it. You
can just create a new one any time you need one.
Properties
enable-proxy
Readable | Writeable | Construct
family
Readable | Writeable | Construct
local-address
Readable | Writeable | Construct
protocol
Readable | Writeable | Construct
proxy-resolver
The proxy resolver to use
Readable | Writeable | Construct
timeout
Readable | Writeable | Construct
tls
Readable | Writeable | Construct
tls-validation-flags
The TLS validation flags used when creating TLS connections. The
default value is TlsCertificateFlags::VALIDATE_ALL
.
GLib guarantees that if certificate verification fails, at least one
flag will be set, but it does not guarantee that all possible flags
will be set. Accordingly, you may not safely decide to ignore any
particular type of error. For example, it would be incorrect to mask
TlsCertificateFlags::EXPIRED
if you want to allow expired certificates,
because this could potentially be the only error flag set even if
other problems exist with the certificate. Therefore, there is no
safe way to use this property. This is not a horrible problem,
though, because you should not be attempting to ignore validation
errors anyway. If you really must ignore TLS certificate errors,
connect to the event
signal, wait for it to be
emitted with SocketClientEvent::TlsHandshaking
, and use that to
connect to accept-certificate
.
Readable | Writeable | Construct
type
Readable | Writeable | Construct
Signals
event
Emitted when client
’s activity on connectable
changes state.
Among other things, this can be used to provide progress
information about a network connection in the UI. The meanings of
the different event
values are as follows:
-
SocketClientEvent::Resolving
:client
is about to look upconnectable
in DNS.connection
will beNone
. -
SocketClientEvent::Resolved
:client
has successfully resolvedconnectable
in DNS.connection
will beNone
. -
SocketClientEvent::Connecting
:client
is about to make a connection to a remote host; either a proxy server or the destination server itself.connection
is theSocketConnection
, which is not yet connected. Since GLib 2.40, you can access the remote address viaSocketConnectionExt::remote_address()
. -
SocketClientEvent::Connected
:client
has successfully connected to a remote host.connection
is the connectedSocketConnection
. -
SocketClientEvent::ProxyNegotiating
:client
is about to negotiate with a proxy to get it to connect toconnectable
.connection
is theSocketConnection
to the proxy server. -
SocketClientEvent::ProxyNegotiated
:client
has negotiated a connection toconnectable
through a proxy server.connection
is the stream returned fromProxyExt::connect()
, which may or may not be aSocketConnection
. -
SocketClientEvent::TlsHandshaking
:client
is about to begin a TLS handshake.connection
is aTlsClientConnection
. -
SocketClientEvent::TlsHandshaked
:client
has successfully completed the TLS handshake.connection
is aTlsClientConnection
. -
SocketClientEvent::Complete
:client
has either successfully connected toconnectable
(in which caseconnection
is theSocketConnection
that it will be returning to the caller) or has failed (in which caseconnection
isNone
and the client is about to return an error).
Each event except SocketClientEvent::Complete
may be emitted
multiple times (or not at all) for a given connectable (in
particular, if client
ends up attempting to connect to more than
one address). However, if client
emits the event
signal at all for a given connectable, then it will always emit
it with SocketClientEvent::Complete
when it is done.
Note that there may be additional SocketClientEvent
values in
the future; unrecognized event
values should be ignored.
Implements
Implementations§
source§impl SocketClient
impl SocketClient
pub const NONE: Option<&'static SocketClient> = None
sourcepub fn new() -> SocketClient
pub fn new() -> SocketClient
Creates a new SocketClient
with the default options.
Returns
a SocketClient
.
Free the returned object with g_object_unref()
.
Trait Implementations§
source§impl Clone for SocketClient
impl Clone for SocketClient
source§impl Debug for SocketClient
impl Debug for SocketClient
source§impl Default for SocketClient
impl Default for SocketClient
source§impl Display for SocketClient
impl Display for SocketClient
source§impl HasParamSpec for SocketClient
impl HasParamSpec for SocketClient
type ParamSpec = ParamSpecObject
§type SetValue = SocketClient
type SetValue = SocketClient
type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, SocketClient>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for SocketClient
impl Hash for SocketClient
source§impl Ord for SocketClient
impl Ord for SocketClient
source§impl ParentClassIs for SocketClient
impl ParentClassIs for SocketClient
source§impl<OT: ObjectType> PartialEq<OT> for SocketClient
impl<OT: ObjectType> PartialEq<OT> for SocketClient
source§impl<OT: ObjectType> PartialOrd<OT> for SocketClient
impl<OT: ObjectType> PartialOrd<OT> for SocketClient
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for SocketClient
impl StaticType for SocketClient
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for SocketClient
Auto Trait Implementations§
impl RefUnwindSafe for SocketClient
impl !Send for SocketClient
impl !Sync for SocketClient
impl Unpin for SocketClient
impl UnwindSafe for SocketClient
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> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere T: ObjectType,
source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere T: ObjectType, Self: IsA<T>,
T
. Read moresource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere T: ObjectType, Self: IsA<T>,
T
. Read moresource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast<T>(self) -> Result<T, Self>where T: ObjectType, Self: CanDowncast<T>,
T
. Read moresource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast_ref<T>(&self) -> Option<&T>where T: ObjectType, Self: CanDowncast<T>,
T
. Read moresource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast
will do many checks at compile-time already. downcast
will
perform the same checks at runtime as dynamic_cast
, but will also ensure some amount of
compile-time safety. Read moresource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moresource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere T: ObjectType,
T
unconditionally. Read moresource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere T: ObjectType,
&T
unconditionally. Read moresource§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> IntoClosureReturnValue for Twhere
T: Into<Value>,
impl<T> IntoClosureReturnValue for Twhere T: Into<Value>,
fn into_closure_return_value(self) -> Option<Value>
source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)where T: ObjectSubclass, <U as ParentClassIs>::Parent: IsSubclassable<T>,
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)where T: ObjectSubclass, <U as ParentClassIs>::Parent: IsSubclassable<T>,
source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere T: ObjectType,
source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere U: StaticType,
true
if the object is an instance of (can be cast to) T
.source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass
of the object. Read moresource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where U: IsClass,
T
. Read moresource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where U: IsInterface,
T
of the object. Read moresource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere V: for<'b> FromValue<'b> + 'static,
property_name
of the object and cast it to the type V. Read moresource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name
of the object. Read moresource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name
of this object. Read moresource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec
of the property property_name
of this object.source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec
of the properties of this object.source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where QD: 'static,
key
. Read moresource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where QD: 'static,
key
. Read moresource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where QD: 'static,
key
. Read moresource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where QD: 'static,
key
. Read moresource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where QD: 'static,
key
. Read moresource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where QD: 'static,
key
. Read moresource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_name
on this object. Read moresource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_id
on this object. Read moresource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_name
on this object. Read moresource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_id
on this object. Read moresource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_name
on this object. Read moresource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_id
on this object. Read moresource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> SignalHandlerId
signal_name
on this object. Read moresource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> SignalHandlerId
signal_id
on this object. Read moresource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure
to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values
, or
invoke
when using Rust closures.source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit
but takes Value
for the arguments.source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Option<Value>
source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue]
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value]
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Option<Value>
source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Option<Value>
source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
notify
signal of the object. Read moresource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + 'static,
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + 'static,
notify
signal of the object. Read moresource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec),
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec),
notify
signal of the object. Read moresource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
source§fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + Send + 'static,
fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>where F: FnOnce() + Send + 'static,
source§fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where F: FnOnce() + 'static,
source§fn bind_property<'f, 't, O, 'a>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
fn bind_property<'f, 't, O, 'a>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str ) -> BindingBuilder<'a, 'f, 't>where O: ObjectType,
source§unsafe fn run_dispose(&self)
unsafe fn run_dispose(&self)
source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere T: HasParamSpec,
source§impl<O> SocketClientExt for Owhere
O: IsA<SocketClient>,
impl<O> SocketClientExt for Owhere O: IsA<SocketClient>,
source§fn add_application_proxy(&self, protocol: &str)
fn add_application_proxy(&self, protocol: &str)
ProxyResolver
,
SocketClient
will consider this protocol as supported but will
not try to find a Proxy
instance to handle handshaking. The
application must check for this case by calling
SocketConnectionExt::remote_address()
on the returned
SocketConnection
, and seeing if it’s a ProxyAddress
of the
appropriate type, to determine whether or not it needs to handle
the proxy handshaking itself. Read moresource§fn connect(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>
fn connect( &self, connectable: &impl IsA<SocketConnectable>, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<SocketConnection, Error>
connectable
and make a network connection to it. Read moresource§fn connect_async<P>(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)where
P: FnOnce(Result<SocketConnection, Error>) + 'static,
fn connect_async<P>( &self, connectable: &impl IsA<SocketConnectable>, cancellable: Option<&impl IsA<Cancellable>>, callback: P )where P: FnOnce(Result<SocketConnection, Error>) + 'static,
fn connect_future( &self, connectable: &impl IsA<SocketConnectable> + Clone + 'static ) -> Pin<Box<dyn Future<Output = Result<SocketConnection, Error>> + 'static, Global>>
source§fn connect_to_host(
&self,
host_and_port: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>
fn connect_to_host( &self, host_and_port: &str, default_port: u16, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<SocketConnection, Error>
source§fn connect_to_host_async<P>(
&self,
host_and_port: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)where
P: FnOnce(Result<SocketConnection, Error>) + 'static,
fn connect_to_host_async<P>( &self, host_and_port: &str, default_port: u16, cancellable: Option<&impl IsA<Cancellable>>, callback: P )where P: FnOnce(Result<SocketConnection, Error>) + 'static,
connect_to_host()
. Read morefn connect_to_host_future( &self, host_and_port: &str, default_port: u16 ) -> Pin<Box<dyn Future<Output = Result<SocketConnection, Error>> + 'static, Global>>
source§fn connect_to_service(
&self,
domain: &str,
service: &str,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>
fn connect_to_service( &self, domain: &str, service: &str, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<SocketConnection, Error>
source§fn connect_to_service_async<P>(
&self,
domain: &str,
service: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)where
P: FnOnce(Result<SocketConnection, Error>) + 'static,
fn connect_to_service_async<P>( &self, domain: &str, service: &str, cancellable: Option<&impl IsA<Cancellable>>, callback: P )where P: FnOnce(Result<SocketConnection, Error>) + 'static,
connect_to_service()
. Read morefn connect_to_service_future( &self, domain: &str, service: &str ) -> Pin<Box<dyn Future<Output = Result<SocketConnection, Error>> + 'static, Global>>
source§fn connect_to_uri(
&self,
uri: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>
fn connect_to_uri( &self, uri: &str, default_port: u16, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<SocketConnection, Error>
source§fn connect_to_uri_async<P>(
&self,
uri: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)where
P: FnOnce(Result<SocketConnection, Error>) + 'static,
fn connect_to_uri_async<P>( &self, uri: &str, default_port: u16, cancellable: Option<&impl IsA<Cancellable>>, callback: P )where P: FnOnce(Result<SocketConnection, Error>) + 'static,
connect_to_uri()
. Read morefn connect_to_uri_future( &self, uri: &str, default_port: u16 ) -> Pin<Box<dyn Future<Output = Result<SocketConnection, Error>> + 'static, Global>>
source§fn enables_proxy(&self) -> bool
fn enables_proxy(&self) -> bool
set_enable_proxy()
Read moresource§fn family(&self) -> SocketFamily
fn family(&self) -> SocketFamily
source§fn local_address(&self) -> Option<SocketAddress>
fn local_address(&self) -> Option<SocketAddress>
source§fn protocol(&self) -> SocketProtocol
fn protocol(&self) -> SocketProtocol
source§fn proxy_resolver(&self) -> ProxyResolver
fn proxy_resolver(&self) -> ProxyResolver
ProxyResolver
being used by self
. Normally, this will
be the resolver returned by ProxyResolver::default()
, but you
can override it with set_proxy_resolver()
. Read moresource§fn socket_type(&self) -> SocketType
fn socket_type(&self) -> SocketType
source§fn tls_validation_flags(&self) -> TlsCertificateFlags
fn tls_validation_flags(&self) -> TlsCertificateFlags
self
. Read moresource§fn set_enable_proxy(&self, enable: bool)
fn set_enable_proxy(&self, enable: bool)
self
attempts to make connections via a
proxy server. When enabled (the default), SocketClient
will use a
ProxyResolver
to determine if a proxy protocol such as SOCKS is
needed, and automatically do the necessary proxy negotiation. Read moresource§fn set_family(&self, family: SocketFamily)
fn set_family(&self, family: SocketFamily)
SocketFamily::Invalid
then the sockets created by this object will be of the specified
family. Read moresource§fn set_local_address(&self, address: Option<&impl IsA<SocketAddress>>)
fn set_local_address(&self, address: Option<&impl IsA<SocketAddress>>)
source§fn set_protocol(&self, protocol: SocketProtocol)
fn set_protocol(&self, protocol: SocketProtocol)
source§fn set_proxy_resolver(&self, proxy_resolver: Option<&impl IsA<ProxyResolver>>)
fn set_proxy_resolver(&self, proxy_resolver: Option<&impl IsA<ProxyResolver>>)
ProxyResolver
used by self
. You can call this if
you want to use specific proxies, rather than using the system
default proxy settings. Read moresource§fn set_socket_type(&self, type_: SocketType)
fn set_socket_type(&self, type_: SocketType)
source§fn set_timeout(&self, timeout: u32)
fn set_timeout(&self, timeout: u32)
self
. timeout
is a
time in seconds, or 0 for no timeout (the default). Read moresource§fn set_tls(&self, tls: bool)
fn set_tls(&self, tls: bool)
self
creates TLS (aka SSL) connections. If tls
is
true
, self
will wrap its connections in a TlsClientConnection
and perform a TLS handshake when connecting. Read moresource§fn set_tls_validation_flags(&self, flags: TlsCertificateFlags)
fn set_tls_validation_flags(&self, flags: TlsCertificateFlags)
self
. The default value is TlsCertificateFlags::VALIDATE_ALL
. Read morefn type_(&self) -> SocketType
fn set_type(&self, type_: SocketType)
source§fn connect_event<F>(&self, f: F) -> SignalHandlerIdwhere
F: Fn(&O, SocketClientEvent, &SocketConnectable, Option<&IOStream>) + 'static,
fn connect_event<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O, SocketClientEvent, &SocketConnectable, Option<&IOStream>) + 'static,
client
’s activity on connectable
changes state.
Among other things, this can be used to provide progress
information about a network connection in the UI. The meanings of
the different event
values are as follows: Read more