pub struct Feature { /* private fields */ }v2_42 only.Expand description
Describes a web engine feature that may be toggled at runtime.
The WebKit web engine includes a set of features which may be toggled
programmatically, each one represented by a Feature that provides
information about it:
- A unique “identifier”: [method
Feature]. - A “default value”, which indicates whether the option is enabled
automatically: [method
Feature]. - Its “status”, which determines whether it should be considered
user-settable and its development stage (see [enum
FeatureStatus] for details): [methodFeature]. - A category, which may be used to group features together:
[method
Feature]. - An optional short “name” which can be presented to an user:
[method
Feature]. - An optional longer “detailed” description:
[method
Feature].
The lists of available features can be obtained with
[funcSettings], [funcSettings],
and [funcSettings]). As a rule of thumb,
applications which may want to allow users (i.e. web developers) to test
WebKit features should use the list of experimental features. Additionally,
applications might want to expose development features when targeting
technically inclined users for early testing of in-development features
(i.e. in “technology preview” or “canary” builds).
Applications must not expose the list of all features to end users because they often lack descriptions and control parts of the web engine which are either intended to be used during development of WebKit itself, or in specific scenarios to tweak how WebKit integrates with the application.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
Source§impl Feature
impl Feature
Sourcepub fn as_ptr(&self) -> *mut WebKitFeature
pub fn as_ptr(&self) -> *mut WebKitFeature
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitFeature) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitFeature) -> &Self
Borrows the underlying C value.
Source§impl Feature
impl Feature
Sourcepub fn category(&self) -> Option<GString>
pub fn category(&self) -> Option<GString>
Gets the category of the feature.
Applications which include user interface to toggle features may want to use the category to group related features together.
§Returns
Feature category.
Sourcepub fn is_default_value(&self) -> bool
pub fn is_default_value(&self) -> bool
Gets whether the feature is enabled by default.
The default value may be used by applications which include user interface
to toggle features to restore its settings to their defaults. Note that
whether a feature is actually enabled must be checked with
[methodSettings].
§Returns
Whether the feature is enabled by default.
Sourcepub fn details(&self) -> Option<GString>
pub fn details(&self) -> Option<GString>
Gets a description for the self.
The detailed description should be considered an additional clarification
on the purpose of the feature, to be used as complementary aid to be
displayed along the feature name returned by [methodFeature].
The returned string is suitable to be displayed to end users, but it
should not be relied upon being localized.
Note that some features may not have a detailed description, and None
is returned in this case.
§Returns
Feature description.
Sourcepub fn identifier(&self) -> Option<GString>
pub fn identifier(&self) -> Option<GString>
Sourcepub fn status(&self) -> FeatureStatus
pub fn status(&self) -> FeatureStatus
Trait Implementations§
Source§impl HasParamSpec for Feature
impl HasParamSpec for Feature
Source§impl Ord for Feature
impl Ord for Feature
Source§impl PartialOrd for Feature
impl PartialOrd for Feature
Source§impl StaticType for Feature
impl StaticType for Feature
Source§fn static_type() -> Type
fn static_type() -> Type
Self.