Enum PermissionType
#[repr(u16)]pub enum PermissionType {
Microphone = 1,
Camera = 2,
ProtectedMediaIdentifier = 3,
PersistentStorage = 4,
}
Expand description
Identifies a type of permission that may be granted to a web origin.
Variants§
Microphone = 1
Permission to access microphone(s).
Camera = 2
Permission to access camera(s).
ProtectedMediaIdentifier = 3
Permission to use device identifier(s) for EME.
PersistentStorage = 4
Permission to use persistent storage.
Implementations§
§impl PermissionType
impl PermissionType
pub fn from_primitive(prim: u16) -> Option<PermissionType>
pub const fn into_primitive(self) -> u16
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
§impl Clone for PermissionType
impl Clone for PermissionType
§fn clone(&self) -> PermissionType
fn clone(&self) -> PermissionType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for PermissionType
impl Debug for PermissionType
§impl<D> Decode<PermissionType, D> for PermissionTypewhere
D: ResourceDialect,
impl<D> Decode<PermissionType, D> for PermissionTypewhere
D: ResourceDialect,
§fn new_empty() -> PermissionType
fn new_empty() -> PermissionType
Creates a valid instance of
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<PermissionType, D> for PermissionTypewhere
D: ResourceDialect,
impl<D> Encode<PermissionType, D> for PermissionTypewhere
D: ResourceDialect,
§impl Hash for PermissionType
impl Hash for PermissionType
§impl Ord for PermissionType
impl Ord for PermissionType
§impl PartialEq for PermissionType
impl PartialEq for PermissionType
§impl PartialOrd for PermissionType
impl PartialOrd for PermissionType
§impl TypeMarker for PermissionType
impl TypeMarker for PermissionType
§type Owned = PermissionType
type Owned = PermissionType
The owned Rust type which this FIDL type decodes into.
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
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
Returns true if the memory layout of
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 ValueTypeMarker for PermissionType
impl ValueTypeMarker for PermissionType
§type Borrowed<'a> = PermissionType
type Borrowed<'a> = PermissionType
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<PermissionType as TypeMarker>::Owned,
) -> <PermissionType as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<PermissionType as TypeMarker>::Owned, ) -> <PermissionType as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.impl Copy for PermissionType
impl Eq for PermissionType
impl StructuralPartialEq for PermissionType
Auto Trait Implementations§
impl Freeze for PermissionType
impl RefUnwindSafe for PermissionType
impl Send for PermissionType
impl Sync for PermissionType
impl Unpin for PermissionType
impl UnwindSafe for PermissionType
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
Mutably borrows from an owned value. Read more