[]Struct gio::SocketConnection

pub struct SocketConnection(_, _);

SocketConnection is a IOStream for a connected socket. They can be created either by SocketClient when connecting to a host, or by SocketListener when accepting a new client.

The type of the SocketConnection object returned from these calls depends on the type of the underlying socket that is in use. For instance, for a TCP/IP connection it will be a TcpConnection.

Choosing what type of object to construct is done with the socket connection factory, and it is possible for 3rd parties to register custom socket connection types for specific combination of socket family/type/protocol using SocketConnection::factory_register_type.

To close a SocketConnection, use IOStreamExt::close. Closing both substreams of the IOStream separately will not close the underlying Socket.

Implements

SocketConnectionExt, IOStreamExt, glib::object::ObjectExt, IOStreamExtManual

Implementations

impl SocketConnection[src]

pub fn factory_lookup_type(
    family: SocketFamily,
    type_: SocketType,
    protocol_id: i32
) -> Type
[src]

Looks up the glib::Type to be used when creating socket connections on sockets with the specified family, type_ and protocol_id.

If no type is registered, the SocketConnection base type is returned.

family

a SocketFamily

type_

a SocketType

protocol_id

a protocol id

Returns

a glib::Type

pub fn factory_register_type(
    g_type: Type,
    family: SocketFamily,
    type_: SocketType,
    protocol: i32
)
[src]

Looks up the glib::Type to be used when creating socket connections on sockets with the specified family, type_ and protocol.

If no type is registered, the SocketConnection base type is returned.

g_type

a glib::Type, inheriting from G_TYPE_SOCKET_CONNECTION

family

a SocketFamily

type_

a SocketType

protocol

a protocol id

Trait Implementations

impl Clone for SocketConnection

impl Debug for SocketConnection

impl Display for SocketConnection[src]

impl Eq for SocketConnection

impl Hash for SocketConnection

impl IsA<IOStream> for SocketConnection

impl IsA<SocketConnection> for TcpConnection

impl Ord for SocketConnection

impl<T: ObjectType> PartialEq<T> for SocketConnection

impl<T: ObjectType> PartialOrd<T> for SocketConnection

impl StaticType for SocketConnection

Auto Trait Implementations

impl RefUnwindSafe for SocketConnection

impl !Send for SocketConnection

impl !Sync for SocketConnection

impl Unpin for SocketConnection

impl UnwindSafe for SocketConnection

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.