Struct soup::Session

source ·
pub struct Session { /* private fields */ }
Expand description

Soup session state object.

#SoupSession is the object that controls client-side HTTP. A #SoupSession encapsulates all of the state that libsoup is keeping on behalf of your program; cached HTTP connections, authentication information, etc. It also keeps track of various global options and features that you are using.

Most applications will only need a single #SoupSession; the primary reason you might need multiple sessions is if you need to have multiple independent authentication contexts. (Eg, you are connecting to a server and authenticating as two different users at different times; the easiest way to ensure that each Message is sent with the authentication information you intended is to use one session for the first user, and a second session for the other user.)

Additional #SoupSession functionality is provided by SessionFeature objects, which can be added to a session with SessionExt::add_feature() or SessionExt::add_feature_by_type() For example, Logger provides support for logging HTTP traffic, ContentDecoder provides support for compressed response handling, and ContentSniffer provides support for HTML5-style response body content sniffing. Additionally, subtypes of Auth can be added as features, to add support for additional authentication types.

All SoupSessions are created with a AuthManager, and support for SOUP_TYPE_AUTH_BASIC and SOUP_TYPE_AUTH_DIGEST. Additionally, sessions using the plain #SoupSession class (rather than one of its deprecated subtypes) have a ContentDecoder by default.

Note that all async methods will invoke their callbacks on the thread-default context at the time of the function call.

§Properties

§accept-language

If non-None, the value to use for the “Accept-Language” header on Messages sent from this session.

Setting this will disable accept-language-auto.

Readable | Writeable

§accept-language-auto

If true, #SoupSession will automatically set the string for the “Accept-Language” header on every Message sent, based on the return value of get_language_names().

Setting this will override any previous value of accept-language.

Readable | Writeable

§idle-timeout

Connection lifetime (in seconds) when idle. Any connection left idle longer than this will be closed.

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call SessionExt::abort() after setting this if you want to ensure that all future connections will have this timeout value.

Readable | Writeable

§local-address

Sets the gio::InetSocketAddress to use for the client side of the connection.

Use this property if you want for instance to bind the local socket to a specific IP address.

Readable | Writeable | Construct Only

§max-conns

The maximum number of connections that the session can open at once.

Readable | Writeable | Construct Only

§max-conns-per-host

The maximum number of connections that the session can open at once to a given host.

Readable | Writeable | Construct Only

§proxy-resolver

A gio::ProxyResolver to use with this session.

If no proxy resolver is set, then the default proxy resolver will be used. See gio::ProxyResolver::default(). You can set it to None if you don’t want to use proxies, or set it to your own gio::ProxyResolver if you want to control what proxies get used.

Readable | Writeable

§remote-connectable

Sets a socket to make outgoing connections on. This will override the default behaviour of opening TCP/IP sockets to the hosts specified in the URIs.

This function is not required for common HTTP usage, but only when connecting to a HTTP service that is not using standard TCP/IP sockets. An example of this is a local service that uses HTTP over UNIX-domain sockets, in that case a Gio::UnixSocketAddress can be passed to this function.

Readable | Writeable | Construct Only

§timeout

The timeout (in seconds) for socket I/O operations (including connecting to a server, and waiting for a reply to an HTTP request).

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call SessionExt::abort() after setting this if you want to ensure that all future connections will have this timeout value.

Not to be confused with idle-timeout (which is the length of time that idle persistent connections will be kept open).

Readable | Writeable

§tls-database

Sets the gio::TlsDatabase to use for validating SSL/TLS certificates.

If no certificate database is set, then the default database will be used. See Gio::TlsBackend::get_default_database().

Readable | Writeable

§tls-interaction

A gio::TlsInteraction object that will be passed on to any Gio::TlsConnections created by the session.

This can be used to provide client-side certificates, for example.

Readable | Writeable

§user-agent

User-Agent string.

If non-None, the value to use for the “User-Agent” header on Messages sent from this session.

RFC 2616 says: “The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests.”

The User-Agent header contains a list of one or more product tokens, separated by whitespace, with the most significant product token coming first. The tokens must be brief, ASCII, and mostly alphanumeric (although “-”, “_”, and “.” are also allowed), and may optionally include a “/” followed by a version string. You may also put comments, enclosed in parentheses, between or after the tokens.

If you set a user-agent property that has trailing whitespace, #SoupSession will append its own product token (eg, libsoup/2.3.2) to the end of the header for you.

Readable | Writeable

§Signals

§request-queued

Emitted when a request is queued on @session.

When sending a request, first request-queued is emitted, indicating that the session has become aware of the request.

After a connection is available to send the request various Message signals are emitted as the message is processed. If the message is requeued, it will emit restarted, which will then be followed by other Message signals when the message is re-sent.

Eventually, the message will emit finished. Normally, this signals the completion of message processing. However, it is possible that the application will requeue the message from the “finished” handler. In that case the process will loop back.

Eventually, a message will reach “finished” and not be requeued. At that point, the session will emit request-unqueued to indicate that it is done with the message.

To sum up: request-queued and request-unqueued are guaranteed to be emitted exactly once, but finished (and all of the other Message signals) may be invoked multiple times for a given message.

§request-unqueued

Emitted when a request is removed from @session’s queue, indicating that @session is done with it.

See request-queued for a detailed description of the message lifecycle within a session.

§Implements

SessionExt, [trait@glib::ObjectExt], SessionExtManual

Implementations§

source§

impl Session

source

pub const NONE: Option<&'static Session> = None

source

pub fn new() -> Session

Creates a #SoupSession with the default options.

§Returns

the new session.

source

pub fn builder() -> SessionBuilder

Creates a new builder-pattern struct instance to construct Session objects.

This method returns an instance of SessionBuilder which can be used to create Session objects.

Trait Implementations§

source§

impl Clone for Session

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Session

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Session

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HasParamSpec for Session

§

type ParamSpec = ParamSpecObject

§

type SetValue = Session

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, Session>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for Session

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Session

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for Session

source§

impl<OT: ObjectType> PartialEq<OT> for Session

source§

fn eq(&self, other: &OT) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for Session

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for Session

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for Session

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

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

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

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 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 more
source§

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 more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

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

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

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)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

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>

Return all ParamSpec of the properties of this object.
source§

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,

Set arbitrary data on this object with the given key. Read more
source§

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 more
source§

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 more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

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 more
source§

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 more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

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)

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 ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

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 more
source§

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]) -> R

Emit signal by signal id. Read more
source§

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]) -> R

Emit signal by its name. Read more
source§

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] ) -> R

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>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> R

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>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

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)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

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,

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,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<O> SessionExt for O
where O: IsA<Session>,

source§

fn abort(&self)

Cancels all pending requests in @self and closes all idle persistent connections.
source§

fn add_feature(&self, feature: &impl IsA<SessionFeature>)

Adds @feature’s functionality to @self. You cannot add multiple features of the same alias::GLib.Type to a session. Read more
source§

fn add_feature_by_type(&self, feature_type: Type)

If @feature_type is the type of a class that implements SessionFeature, this creates a new feature of that type and adds it to @self as with add_feature(). You can use this when you don’t need to customize the new feature in any way. Adding multiple features of the same @feature_type is not allowed. Read more
source§

fn accept_language(&self) -> Option<GString>

Get the value used by @self for the “Accept-Language” header on new requests. Read more
source§

fn accepts_language_auto(&self) -> bool

Gets whether @self automatically sets the “Accept-Language” header on new requests. Read more
source§

fn async_result_message( &self, result: &impl IsA<AsyncResult> ) -> Option<Message>

Gets the Message of the @result asynchronous operation This is useful to get the Message of an asynchronous operation started by @self from its `callback::Gio::AsyncReadyCallback. Read more
source§

fn feature(&self, feature_type: Type) -> Option<SessionFeature>

Gets the feature in @self of type @feature_type. Read more
source§

fn feature_for_message( &self, feature_type: Type, msg: &Message ) -> Option<SessionFeature>

Gets the feature in @self of type @feature_type, provided that it is not disabled for @msg. Read more
source§

fn idle_timeout(&self) -> u32

Get the timeout in seconds for idle connection lifetime currently used by @self. Read more
source§

fn local_address(&self) -> Option<InetSocketAddress>

Get the gio::InetSocketAddress to use for the client side of connections in @self. Read more
source§

fn max_conns(&self) -> u32

Get the maximum number of connections that @self can open at once. Read more
source§

fn max_conns_per_host(&self) -> u32

Get the maximum number of connections that @self can open at once to a given host. Read more
source§

fn proxy_resolver(&self) -> Option<ProxyResolver>

Get the gio::ProxyResolver currently used by @self. Read more
source§

fn remote_connectable(&self) -> Option<SocketConnectable>

Gets the remote connectable if one set. Read more
source§

fn timeout(&self) -> u32

Get the timeout in seconds for socket I/O operations currently used by @self. Read more
source§

fn tls_database(&self) -> Option<TlsDatabase>

Get the gio::TlsDatabase currently used by @self. Read more
source§

fn tls_interaction(&self) -> Option<TlsInteraction>

Get the gio::TlsInteraction currently used by @self. Read more
source§

fn user_agent(&self) -> Option<GString>

Get the value used by @self for the “User-Agent” header on new requests. Read more
source§

fn has_feature(&self, feature_type: Type) -> bool

Tests if @self has at a feature of type @feature_type (which can be the type of either a SessionFeature, or else a subtype of some class managed by another feature, such as Auth). Read more
source§

fn preconnect_async<P: FnOnce(Result<(), Error>) + 'static>( &self, msg: &Message, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Start a preconnection to @msg. Read more
source§

fn preconnect_future( &self, msg: &Message, io_priority: Priority ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source§

fn remove_feature(&self, feature: &impl IsA<SessionFeature>)

Removes @feature’s functionality from @self. Read more
source§

fn remove_feature_by_type(&self, feature_type: Type)

Removes all features of type @feature_type (or any subclass of @feature_type) from @self. Read more
source§

fn send( &self, msg: &Message, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<InputStream, Error>

Synchronously sends @msg and waits for the beginning of a response. Read more
source§

fn send_and_read( &self, msg: &Message, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<Bytes, Error>

Synchronously sends @msg and reads the response body. Read more
source§

fn send_and_read_async<P: FnOnce(Result<Bytes, Error>) + 'static>( &self, msg: &Message, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Asynchronously sends @msg and reads the response body. Read more
source§

fn send_and_read_future( &self, msg: &Message, io_priority: Priority ) -> Pin<Box_<dyn Future<Output = Result<Bytes, Error>> + 'static>>

source§

fn send_and_splice( &self, msg: &Message, out_stream: &impl IsA<OutputStream>, flags: OutputStreamSpliceFlags, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<isize, Error>

Synchronously sends @msg and splices the response body stream into @out_stream. Read more
source§

fn send_and_splice_async<P: FnOnce(Result<isize, Error>) + 'static>( &self, msg: &Message, out_stream: &impl IsA<OutputStream>, flags: OutputStreamSpliceFlags, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Asynchronously sends @msg and splices the response body stream into @out_stream. When @callback is called, then either @msg has been sent and its response body spliced, or else an error has occurred. Read more
source§

fn send_and_splice_future( &self, msg: &Message, out_stream: &(impl IsA<OutputStream> + Clone + 'static), flags: OutputStreamSpliceFlags, io_priority: Priority ) -> Pin<Box_<dyn Future<Output = Result<isize, Error>> + 'static>>

source§

fn send_async<P: FnOnce(Result<InputStream, Error>) + 'static>( &self, msg: &Message, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Asynchronously sends @msg and waits for the beginning of a response. Read more
source§

fn send_future( &self, msg: &Message, io_priority: Priority ) -> Pin<Box_<dyn Future<Output = Result<InputStream, Error>> + 'static>>

source§

fn set_accept_language(&self, accept_language: &str)

Set the value to use for the “Accept-Language” header on Messages sent from @self. Read more
source§

fn set_accept_language_auto(&self, accept_language_auto: bool)

Set whether @self will automatically set the “Accept-Language” header on requests using a value generated from system languages based on get_language_names(). Read more
source§

fn set_idle_timeout(&self, timeout: u32)

Set a timeout in seconds for idle connection lifetime to be used by @self on new connections. Read more
source§

fn set_proxy_resolver(&self, proxy_resolver: Option<&impl IsA<ProxyResolver>>)

Set a gio::ProxyResolver to be used by @self on new connections. Read more
source§

fn set_timeout(&self, timeout: u32)

Set a timeout in seconds for socket I/O operations to be used by @self on new connections. Read more
source§

fn set_tls_database(&self, tls_database: Option<&impl IsA<TlsDatabase>>)

Set a GIo::TlsDatabase to be used by @self on new connections. Read more
source§

fn set_tls_interaction( &self, tls_interaction: Option<&impl IsA<TlsInteraction>> )

Set a gio::TlsInteraction to be used by @self on new connections. Read more
source§

fn set_user_agent(&self, user_agent: &str)

Set the value to use for the “User-Agent” header on Messages sent from @self. Read more
source§

fn connect_request_queued<F: Fn(&Self, &Message) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when a request is queued on @session. Read more
source§

fn connect_request_unqueued<F: Fn(&Self, &Message) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when a request is removed from @session’s queue, indicating that @session is done with it. Read more
source§

fn connect_accept_language_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_accept_language_auto_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_idle_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_proxy_resolver_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_tls_database_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_tls_interaction_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_user_agent_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

impl<O> SessionExtManual for O
where O: IsA<Session>,

source§

fn websocket_connect_async<P: FnOnce(Result<WebsocketConnection, Error>) + 'static>( &self, msg: &Message, origin: Option<&str>, protocols: &[&str], io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

source§

fn websocket_connect_async_future( &self, msg: &Message, origin: Option<&str>, protocols: &[&str], io_priority: Priority ) -> Pin<Box_<dyn Future<Output = Result<WebsocketConnection, Error>> + 'static>>

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

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