pub struct ContextFeatureFlags(/* private fields */);
Expand description
Feature flags that allow augmenting Context behavior. Some features require additional services
in the service directory provided during context initialization. See
[CreateContextParams.service_directory
].
Implementations§
Source§impl ContextFeatureFlags
impl ContextFeatureFlags
Sourcepub const NETWORK: Self = _
pub const NETWORK: Self = _
Enables network access. Requires the following services:
- [
fuchsia.net.interfaces/State
] - [
fuchsia.net.name/Lookup
] - [
fuchsia.posix.socket/Provider
]
Sourcepub const AUDIO: Self = _
pub const AUDIO: Self = _
Enables audio input and output. Requires the following services:
- [
fuchsia.media/Audio
] - [
fuchsia.media/AudioDeviceEnumerator
] - [
fuchsia.media/SessionAudioConsumerFactory
]
Sourcepub const VULKAN: Self = _
pub const VULKAN: Self = _
Enables GPU-accelerated rendering of the web content. Requires the following services:
- [
fuchsia.vulkan.loader/Loader
] The following service is required in order to collect Vulkan trace data. - [
fuchsia.tracing.provider.Registry
]
Sourcepub const HARDWARE_VIDEO_DECODER: Self = _
pub const HARDWARE_VIDEO_DECODER: Self = _
Enables hardware video decoding.
[ContextFeatureFlags.VULKAN
] must be enabled as well.
Requires the following service:
- [
fuchsia.mediacodec/CodecFactory
]
Sourcepub const HARDWARE_VIDEO_DECODER_ONLY: Self = _
pub const HARDWARE_VIDEO_DECODER_ONLY: Self = _
Disables video codecs that cannot be decoded in hardware.
Software decoders will only be used as fallbacks for hardware decoders, such as when
insufficient resources are available.
Requires [ContextFeatureFlags.HARDWARE_VIDEO_DECODER
].
Sourcepub const WIDEVINE_CDM: Self = _
pub const WIDEVINE_CDM: Self = _
Enables Widevine CDM modules for EME API.
[ContextFeatureFlags.VULKAN
] must be enabled as well.
Requires [fuchsia.media.drm/Widevine
] service. Requires that a cdm_data_directory
be
specified in CreateContextParams
.
Sourcepub const HEADLESS: Self = _
pub const HEADLESS: Self = _
Allows embedders to render web content without graphical output or Scenic.
Not compatible with [ContextFeatureFlags.VULKAN
].
Sourcepub const LEGACYMETRICS: Self = _
pub const LEGACYMETRICS: Self = _
Report telemetry data to the [fuchsia.legacymetrics/MetricsRecorder
].
Sourcepub const KEYBOARD: Self = _
pub const KEYBOARD: Self = _
Enables input events for keyboard keypresses.
Requires [fuchsia.ui.input3/Keyboard
], from which the events are obtained.
Sourcepub const VIRTUAL_KEYBOARD: Self = _
pub const VIRTUAL_KEYBOARD: Self = _
Enables the use of onscreen virtual keyboards. The implementation will manage the state of
the keyboard in response to input/focus events in web content.
Requires the [fuchsia.input.virtualkeyboard/ControllerCreator
] service and
[ContextFeatureFlags.KEYBOARD
].
Sourcepub const DISABLE_DYNAMIC_CODE_GENERATION: Self = _
pub const DISABLE_DYNAMIC_CODE_GENERATION: Self = _
Disables dynamic generation of machine-code from scripts (e.g. JavaScript) and other
technologies (e.g. WebAssembly). This should typically result in scripts being executed
by an interpreter, with associated loss in performance. Other technologies relying on
dynamic code generation may be provided in a limited form where feasible, or unavailable
if interpreting would render them unusable (as is likely the case for WebAssembly).
[fuchsia.kernel/VmexResource
] is not required if this option is set.
Source§impl ContextFeatureFlags
impl ContextFeatureFlags
Sourcepub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u64) -> Self
pub const fn from_bits_retain(bits: u64) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl ContextFeatureFlags
impl ContextFeatureFlags
Sourcepub const fn iter(&self) -> Iter<ContextFeatureFlags>
pub const fn iter(&self) -> Iter<ContextFeatureFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<ContextFeatureFlags>
pub const fn iter_names(&self) -> IterNames<ContextFeatureFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Source§impl ContextFeatureFlags
impl ContextFeatureFlags
pub fn has_unknown_bits(&self) -> bool
has_unknown_bits
pub fn get_unknown_bits(&self) -> u64
get_unknown_bits
Trait Implementations§
Source§impl Binary for ContextFeatureFlags
impl Binary for ContextFeatureFlags
Source§impl BitAnd for ContextFeatureFlags
impl BitAnd for ContextFeatureFlags
Source§impl BitAndAssign for ContextFeatureFlags
impl BitAndAssign for ContextFeatureFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOr for ContextFeatureFlags
impl BitOr for ContextFeatureFlags
Source§fn bitor(self, other: ContextFeatureFlags) -> Self
fn bitor(self, other: ContextFeatureFlags) -> Self
The bitwise or (|
) of the bits in two flags values.
Source§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
|
operator.Source§impl BitOrAssign for ContextFeatureFlags
impl BitOrAssign for ContextFeatureFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXor for ContextFeatureFlags
impl BitXor for ContextFeatureFlags
Source§impl BitXorAssign for ContextFeatureFlags
impl BitXorAssign for ContextFeatureFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Clone for ContextFeatureFlags
impl Clone for ContextFeatureFlags
Source§fn clone(&self) -> ContextFeatureFlags
fn clone(&self) -> ContextFeatureFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ContextFeatureFlags
impl Debug for ContextFeatureFlags
Source§impl<D: ResourceDialect> Decode<ContextFeatureFlags, D> for ContextFeatureFlags
impl<D: ResourceDialect> Decode<ContextFeatureFlags, D> for ContextFeatureFlags
Source§impl Default for ContextFeatureFlags
impl Default for ContextFeatureFlags
Source§fn default() -> ContextFeatureFlags
fn default() -> ContextFeatureFlags
Source§impl<D: ResourceDialect> Encode<ContextFeatureFlags, D> for ContextFeatureFlags
impl<D: ResourceDialect> Encode<ContextFeatureFlags, D> for ContextFeatureFlags
Source§impl Extend<ContextFeatureFlags> for ContextFeatureFlags
impl Extend<ContextFeatureFlags> for ContextFeatureFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for ContextFeatureFlags
impl Flags for ContextFeatureFlags
Source§const FLAGS: &'static [Flag<ContextFeatureFlags>] = _
const FLAGS: &'static [Flag<ContextFeatureFlags>] = _
Source§fn from_bits_retain(bits: u64) -> ContextFeatureFlags
fn from_bits_retain(bits: u64) -> ContextFeatureFlags
§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<ContextFeatureFlags> for ContextFeatureFlags
impl FromIterator<ContextFeatureFlags> for ContextFeatureFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl Hash for ContextFeatureFlags
impl Hash for ContextFeatureFlags
Source§impl IntoIterator for ContextFeatureFlags
impl IntoIterator for ContextFeatureFlags
Source§impl LowerHex for ContextFeatureFlags
impl LowerHex for ContextFeatureFlags
Source§impl Not for ContextFeatureFlags
impl Not for ContextFeatureFlags
Source§impl Octal for ContextFeatureFlags
impl Octal for ContextFeatureFlags
Source§impl Ord for ContextFeatureFlags
impl Ord for ContextFeatureFlags
Source§fn cmp(&self, other: &ContextFeatureFlags) -> Ordering
fn cmp(&self, other: &ContextFeatureFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ContextFeatureFlags
impl PartialEq for ContextFeatureFlags
Source§impl PartialOrd for ContextFeatureFlags
impl PartialOrd for ContextFeatureFlags
Source§impl PublicFlags for ContextFeatureFlags
impl PublicFlags for ContextFeatureFlags
Source§impl Sub for ContextFeatureFlags
impl Sub for ContextFeatureFlags
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
-
operator.Source§impl SubAssign for ContextFeatureFlags
impl SubAssign for ContextFeatureFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§impl TypeMarker for ContextFeatureFlags
impl TypeMarker for ContextFeatureFlags
Source§type Owned = ContextFeatureFlags
type Owned = ContextFeatureFlags
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl UpperHex for ContextFeatureFlags
impl UpperHex for ContextFeatureFlags
Source§impl ValueTypeMarker for ContextFeatureFlags
impl ValueTypeMarker for ContextFeatureFlags
Source§type Borrowed<'a> = ContextFeatureFlags
type Borrowed<'a> = ContextFeatureFlags
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for ContextFeatureFlags
impl Eq for ContextFeatureFlags
impl StructuralPartialEq for ContextFeatureFlags
Auto Trait Implementations§
impl Freeze for ContextFeatureFlags
impl RefUnwindSafe for ContextFeatureFlags
impl Send for ContextFeatureFlags
impl Sync for ContextFeatureFlags
impl Unpin for ContextFeatureFlags
impl UnwindSafe for ContextFeatureFlags
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)