Struct ContextFeatureFlags
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§
§impl ContextFeatureFlags
impl ContextFeatureFlags
pub const NETWORK: ContextFeatureFlags
pub const NETWORK: ContextFeatureFlags
Enables network access. Requires the following services:
- [
fuchsia.net.interfaces/State
] - [
fuchsia.net.name/Lookup
] - [
fuchsia.posix.socket/Provider
]
pub const AUDIO: ContextFeatureFlags
pub const AUDIO: ContextFeatureFlags
Enables audio input and output. Requires the following services:
- [
fuchsia.media/Audio
] - [
fuchsia.media/AudioDeviceEnumerator
] - [
fuchsia.media/SessionAudioConsumerFactory
]
pub const VULKAN: ContextFeatureFlags
pub const VULKAN: ContextFeatureFlags
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
]
pub const HARDWARE_VIDEO_DECODER: ContextFeatureFlags
pub const HARDWARE_VIDEO_DECODER: ContextFeatureFlags
Enables hardware video decoding.
[ContextFeatureFlags.VULKAN
] must be enabled as well.
Requires the following service:
- [
fuchsia.mediacodec/CodecFactory
]
pub const HARDWARE_VIDEO_DECODER_ONLY: ContextFeatureFlags
pub const HARDWARE_VIDEO_DECODER_ONLY: ContextFeatureFlags
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
].
pub const WIDEVINE_CDM: ContextFeatureFlags
pub const WIDEVINE_CDM: ContextFeatureFlags
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
].
pub const HEADLESS: ContextFeatureFlags
pub const HEADLESS: ContextFeatureFlags
Allows embedders to render web content without graphical output or Scenic.
Not compatible with [ContextFeatureFlags.VULKAN
].
pub const LEGACYMETRICS: ContextFeatureFlags
pub const LEGACYMETRICS: ContextFeatureFlags
Report telemetry data to the [fuchsia.legacymetrics/MetricsRecorder
].
pub const KEYBOARD: ContextFeatureFlags
pub const KEYBOARD: ContextFeatureFlags
Enables input events for keyboard keypresses.
Requires [fuchsia.ui.input3/Keyboard
], from which the events are obtained.
pub const VIRTUAL_KEYBOARD: ContextFeatureFlags
pub const VIRTUAL_KEYBOARD: ContextFeatureFlags
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
].
pub const DISABLE_DYNAMIC_CODE_GENERATION: ContextFeatureFlags
pub const DISABLE_DYNAMIC_CODE_GENERATION: ContextFeatureFlags
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.
§impl ContextFeatureFlags
impl ContextFeatureFlags
pub const fn empty() -> ContextFeatureFlags
pub const fn empty() -> ContextFeatureFlags
Get a flags value with all bits unset.
pub const fn all() -> ContextFeatureFlags
pub const fn all() -> ContextFeatureFlags
Get a flags value with all known bits set.
pub 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.
pub const fn from_bits(bits: u64) -> Option<ContextFeatureFlags>
pub const fn from_bits(bits: u64) -> Option<ContextFeatureFlags>
Convert from a bits value.
This method will return None
if any unknown bits are set.
pub const fn from_bits_truncate(bits: u64) -> ContextFeatureFlags
pub const fn from_bits_truncate(bits: u64) -> ContextFeatureFlags
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u64) -> ContextFeatureFlags
pub const fn from_bits_retain(bits: u64) -> ContextFeatureFlags
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<ContextFeatureFlags>
pub fn from_name(name: &str) -> Option<ContextFeatureFlags>
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.
pub const fn intersects(&self, other: ContextFeatureFlags) -> bool
pub const fn intersects(&self, other: ContextFeatureFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
pub const fn contains(&self, other: ContextFeatureFlags) -> bool
pub const fn contains(&self, other: ContextFeatureFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
pub fn insert(&mut self, other: ContextFeatureFlags)
pub fn insert(&mut self, other: ContextFeatureFlags)
The bitwise or (|
) of the bits in two flags values.
pub fn remove(&mut self, other: ContextFeatureFlags)
pub fn remove(&mut self, other: ContextFeatureFlags)
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.
pub fn toggle(&mut self, other: ContextFeatureFlags)
pub fn toggle(&mut self, other: ContextFeatureFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
pub fn set(&mut self, other: ContextFeatureFlags, value: bool)
pub fn set(&mut self, other: ContextFeatureFlags, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
pub const fn intersection(
self,
other: ContextFeatureFlags,
) -> ContextFeatureFlags
pub const fn intersection( self, other: ContextFeatureFlags, ) -> ContextFeatureFlags
The bitwise and (&
) of the bits in two flags values.
pub const fn union(self, other: ContextFeatureFlags) -> ContextFeatureFlags
pub const fn union(self, other: ContextFeatureFlags) -> ContextFeatureFlags
The bitwise or (|
) of the bits in two flags values.
pub const fn difference(self, other: ContextFeatureFlags) -> ContextFeatureFlags
pub const fn difference(self, other: ContextFeatureFlags) -> ContextFeatureFlags
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.
pub const fn symmetric_difference(
self,
other: ContextFeatureFlags,
) -> ContextFeatureFlags
pub const fn symmetric_difference( self, other: ContextFeatureFlags, ) -> ContextFeatureFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
pub const fn complement(self) -> ContextFeatureFlags
pub const fn complement(self) -> ContextFeatureFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§impl ContextFeatureFlags
impl ContextFeatureFlags
pub 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.
pub 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.
§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§
§impl Binary for ContextFeatureFlags
impl Binary for ContextFeatureFlags
§impl BitAnd for ContextFeatureFlags
impl BitAnd for ContextFeatureFlags
§fn bitand(self, other: ContextFeatureFlags) -> ContextFeatureFlags
fn bitand(self, other: ContextFeatureFlags) -> ContextFeatureFlags
The bitwise and (&
) of the bits in two flags values.
§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
&
operator.§impl BitAndAssign for ContextFeatureFlags
impl BitAndAssign for ContextFeatureFlags
§fn bitand_assign(&mut self, other: ContextFeatureFlags)
fn bitand_assign(&mut self, other: ContextFeatureFlags)
The bitwise and (&
) of the bits in two flags values.
§impl BitOr for ContextFeatureFlags
impl BitOr for ContextFeatureFlags
§fn bitor(self, other: ContextFeatureFlags) -> ContextFeatureFlags
fn bitor(self, other: ContextFeatureFlags) -> ContextFeatureFlags
The bitwise or (|
) of the bits in two flags values.
§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
|
operator.§impl BitOrAssign for ContextFeatureFlags
impl BitOrAssign for ContextFeatureFlags
§fn bitor_assign(&mut self, other: ContextFeatureFlags)
fn bitor_assign(&mut self, other: ContextFeatureFlags)
The bitwise or (|
) of the bits in two flags values.
§impl BitXor for ContextFeatureFlags
impl BitXor for ContextFeatureFlags
§fn bitxor(self, other: ContextFeatureFlags) -> ContextFeatureFlags
fn bitxor(self, other: ContextFeatureFlags) -> ContextFeatureFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
^
operator.§impl BitXorAssign for ContextFeatureFlags
impl BitXorAssign for ContextFeatureFlags
§fn bitxor_assign(&mut self, other: ContextFeatureFlags)
fn bitxor_assign(&mut self, other: ContextFeatureFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
§impl Clone for ContextFeatureFlags
impl Clone for ContextFeatureFlags
§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 more§impl Debug for ContextFeatureFlags
impl Debug for ContextFeatureFlags
§impl<D> Decode<ContextFeatureFlags, D> for ContextFeatureFlagswhere
D: ResourceDialect,
impl<D> Decode<ContextFeatureFlags, D> for ContextFeatureFlagswhere
D: ResourceDialect,
§fn new_empty() -> ContextFeatureFlags
fn new_empty() -> ContextFeatureFlags
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for ContextFeatureFlags
impl Default for ContextFeatureFlags
§fn default() -> ContextFeatureFlags
fn default() -> ContextFeatureFlags
§impl<D> Encode<ContextFeatureFlags, D> for ContextFeatureFlagswhere
D: ResourceDialect,
impl<D> Encode<ContextFeatureFlags, D> for ContextFeatureFlagswhere
D: ResourceDialect,
§impl Extend<ContextFeatureFlags> for ContextFeatureFlags
impl Extend<ContextFeatureFlags> for ContextFeatureFlags
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ContextFeatureFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ContextFeatureFlags>,
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
)§impl Flags for ContextFeatureFlags
impl Flags for ContextFeatureFlags
§const FLAGS: &'static [Flag<ContextFeatureFlags>]
const FLAGS: &'static [Flag<ContextFeatureFlags>]
§fn from_bits_retain(bits: u64) -> ContextFeatureFlags
fn from_bits_retain(bits: u64) -> ContextFeatureFlags
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.§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.§impl FromIterator<ContextFeatureFlags> for ContextFeatureFlags
impl FromIterator<ContextFeatureFlags> for ContextFeatureFlags
§fn from_iter<T>(iterator: T) -> ContextFeatureFlagswhere
T: IntoIterator<Item = ContextFeatureFlags>,
fn from_iter<T>(iterator: T) -> ContextFeatureFlagswhere
T: IntoIterator<Item = ContextFeatureFlags>,
The bitwise or (|
) of the bits in each flags value.
§impl Hash for ContextFeatureFlags
impl Hash for ContextFeatureFlags
§impl IntoIterator for ContextFeatureFlags
impl IntoIterator for ContextFeatureFlags
§type Item = ContextFeatureFlags
type Item = ContextFeatureFlags
§type IntoIter = Iter<ContextFeatureFlags>
type IntoIter = Iter<ContextFeatureFlags>
§fn into_iter(self) -> <ContextFeatureFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <ContextFeatureFlags as IntoIterator>::IntoIter
§impl LowerHex for ContextFeatureFlags
impl LowerHex for ContextFeatureFlags
§impl Not for ContextFeatureFlags
impl Not for ContextFeatureFlags
§fn not(self) -> ContextFeatureFlags
fn not(self) -> ContextFeatureFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
!
operator.§impl Octal for ContextFeatureFlags
impl Octal for ContextFeatureFlags
§impl Ord for ContextFeatureFlags
impl Ord for ContextFeatureFlags
§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,
§impl PartialEq for ContextFeatureFlags
impl PartialEq for ContextFeatureFlags
§impl PartialOrd for ContextFeatureFlags
impl PartialOrd for ContextFeatureFlags
§impl Sub for ContextFeatureFlags
impl Sub for ContextFeatureFlags
§fn sub(self, other: ContextFeatureFlags) -> ContextFeatureFlags
fn sub(self, other: ContextFeatureFlags) -> ContextFeatureFlags
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.
§type Output = ContextFeatureFlags
type Output = ContextFeatureFlags
-
operator.§impl SubAssign for ContextFeatureFlags
impl SubAssign for ContextFeatureFlags
§fn sub_assign(&mut self, other: ContextFeatureFlags)
fn sub_assign(&mut self, other: ContextFeatureFlags)
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.
§impl TypeMarker for ContextFeatureFlags
impl TypeMarker for ContextFeatureFlags
§type Owned = ContextFeatureFlags
type Owned = ContextFeatureFlags
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§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.§impl UpperHex for ContextFeatureFlags
impl UpperHex for ContextFeatureFlags
§impl ValueTypeMarker for ContextFeatureFlags
impl ValueTypeMarker for ContextFeatureFlags
§type Borrowed<'a> = ContextFeatureFlags
type Borrowed<'a> = ContextFeatureFlags
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<ContextFeatureFlags as TypeMarker>::Owned,
) -> <ContextFeatureFlags as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<ContextFeatureFlags as TypeMarker>::Owned, ) -> <ContextFeatureFlags as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.