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.
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 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
This method tests less than or equal to (for
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
Returns the type identifier of
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
Mutably borrows from an owned value. Read more
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>,
Upcasts an object to a superclass or interface
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>,
Upcasts an object to a reference of its superclass or interface
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>,
Tries to downcast to a subclass or interface implementor
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>,
Tries to downcast to a reference of its subclass or interface implementor
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,
Tries to cast to an object of type
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§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where T: ObjectType,
Tries to cast to reference to an object of type
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,
Casts to
T
unconditionally. Read moresource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere T: ObjectType,
Casts to
&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<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,
Returns
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>
Returns the
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,
Returns the class of the object in the given type
T
. Read moresource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where U: IsInterface,
Returns the interface
T
of the object. Read moresource§fn set_property<V>(&self, property_name: &str, value: V)where
V: ToValue,
fn set_property<V>(&self, property_name: &str, value: V)where V: ToValue,
source§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)])
Sets multiple properties of the object at once. Read more
source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Sets multiple properties of the object at once. Read more
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,
Gets the property
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
Gets the property
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>
Get the type of the property
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>
Get the
ParamSpec
of the property property_name
of this object.source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
Return all
ParamSpec
of the properties of this object.source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Freeze all property notifications until the return guard object is dropped. Read more
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,
Set arbitrary data on this object with the given
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,
Return previously set arbitrary data of this object with the given
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,
Retrieve previously set arbitrary data of this object with the given
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,
Set arbitrary data on this object with the given
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,
Return previously set arbitrary data of this object with the given
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,
Retrieve previously set arbitrary data of this object with the given
key
. Read moresource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Block a given signal handler. Read more
source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Unblock a given signal handler.
source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Stop emission of the currently emitted signal.
source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Stop emission of the currently emitted signal by the (possibly detailed) signal name.
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,
Connect to the signal
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,
Connect to the signal
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,
Connect to the signal
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,
Connect to the signal
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>,
Connect to the signal
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>,
Connect to the signal
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
Connect a closure to the signal
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
Connect a closure to the signal
signal_id
on this object. Read moresource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
Limits the lifetime of
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,
Emit signal by signal id. Read more
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>
Same as
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,
Emit signal by its name. Read more
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>
Emit signal by its name. Read more
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,
Emit signal by its name with details. Read more
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>
Emit signal by its name with details. Read more
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,
Emit signal by signal id with details. Read more
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>
Emit signal by signal id with details. Read more
source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Disconnect a previously connected signal handler.
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,
Connect to the
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,
Connect to the
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),
Connect to the
notify
signal of the object. Read moresource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
Notify that the given property has changed its value. Read more
source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
Notify that the given property has changed its value. Read more
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,
Add a callback to be notified when the Object is disposed.
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,
Add a callback to be notified when the Object is disposed. Read more
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)
Runs the dispose mechanism of the object. Read more
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)
Enable proxy protocols to be handled by the application. When the
indicated proxy protocol is returned by the
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>
Tries to resolve the
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,
This is the asynchronous version of
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>
Attempts to create a TCP connection to a service. Read more
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,
This is the asynchronous version of
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,
This is the asynchronous version of
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
Gets the proxy enable state; see
set_enable_proxy()
Read moresource§fn family(&self) -> SocketFamily
fn family(&self) -> SocketFamily
Gets the socket family of the socket client. Read more
source§fn local_address(&self) -> Option<SocketAddress>
fn local_address(&self) -> Option<SocketAddress>
Gets the local address of the socket client. Read more
source§fn protocol(&self) -> SocketProtocol
fn protocol(&self) -> SocketProtocol
Gets the protocol name type of the socket client. Read more
source§fn proxy_resolver(&self) -> ProxyResolver
fn proxy_resolver(&self) -> ProxyResolver
Gets the
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
Gets the socket type of the socket client. Read more
source§fn tls_validation_flags(&self) -> TlsCertificateFlags
fn tls_validation_flags(&self) -> TlsCertificateFlags
Gets the TLS validation flags used creating TLS connections via
self
. Read moresource§fn set_enable_proxy(&self, enable: bool)
fn set_enable_proxy(&self, enable: bool)
Sets whether or not
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)
Sets the socket family of the socket client.
If this is set to something other than
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)
Sets the protocol of the socket client.
The sockets created by this object will use of the specified
protocol. Read more
source§fn set_proxy_resolver(&self, proxy_resolver: Option<&impl IsA<ProxyResolver>>)
fn set_proxy_resolver(&self, proxy_resolver: Option<&impl IsA<ProxyResolver>>)
Overrides the
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)
Sets the socket type of the socket client.
The sockets created by this object will be of the specified
type. Read more
source§fn set_timeout(&self, timeout: u32)
fn set_timeout(&self, timeout: u32)
Sets the I/O timeout for sockets created by
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)
Sets whether
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)
Sets the TLS validation flags used when creating TLS connections
via
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,
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: Read morefn connect_enable_proxy_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_family_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_local_address_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_protocol_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_proxy_resolver_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_timeout_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_tls_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_tls_validation_flags_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
fn connect_type_notify<F>(&self, f: F) -> SignalHandlerIdwhere F: Fn(&O) + 'static,
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere T: StaticType,
source§fn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.