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 #WebKitFeature that provides information about it:
- A unique “identifier”:
identifier()
. - A “default value”, which indicates whether the option is enabled
automatically:
is_default_value()
. - Its “status”, which determines whether it should be considered
user-settable and its development stage (see
FeatureStatus
for details):status()
. - A category, which may be used to group features together:
category()
. - An optional short “name” which can be presented to an user:
name()
. - An optional longer “detailed” description:
details()
.
The lists of available features can be obtained with
get_all_features()
, get_experimental_features()
,
and get_development_features()
). 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
Settings::is_feature_enabled()
.
§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 name()
.
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 @NULL is returned in this case.
§Returns
Feature description.
sourcepub fn identifier(&self) -> Option<GString>
pub fn identifier(&self) -> Option<GString>
sourcepub fn name(&self) -> Option<GString>
pub fn name(&self) -> Option<GString>
Gets a short name for the @self.
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 short name, and @NULL is returned in this case.
§Returns
Short feature name.
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 PartialEq for Feature
impl PartialEq for Feature
source§impl PartialOrd for Feature
impl PartialOrd for Feature
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 Feature
impl StaticType for Feature
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for Feature
impl StructuralPartialEq for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl !Send for Feature
impl !Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)