#[repr(C)]pub struct CryptoKey<D: DomTypes> {
reflector_: Reflector,
key_type: KeyType,
extractable: bool,
algorithm: KeyAlgorithmAndDerivatives,
algorithm_cached: Heap<*mut JSObject>,
usages: Vec<KeyUsage>,
usages_cached: Heap<*mut JSObject>,
handle: Handle,
phantom: PhantomData<D>,
}Expand description
Fields§
§reflector_: Reflector§key_type: KeyType§extractable: bool§algorithm: KeyAlgorithmAndDerivativeshttps://w3c.github.io/webcrypto/#dfn-CryptoKey-slot-algorithm
The contents of the [[algorithm]] internal slot shall be, or be derived from, a KeyAlgorithm.
algorithm_cached: Heap<*mut JSObject>§usages: Vec<KeyUsage>https://w3c.github.io/webcrypto/#dfn-CryptoKey-slot-usages
The contents of the [[usages]] internal slot shall be of type Sequence
usages_cached: Heap<*mut JSObject>§handle: Handle§phantom: PhantomData<D>Implementations§
Source§impl<D> CryptoKey<D>where
D: Equivalence,
impl<D> CryptoKey<D>where
D: Equivalence,
fn new_inherited( key_type: KeyType, extractable: bool, algorithm: KeyAlgorithmAndDerivatives, usages: Vec<KeyUsage>, handle: Handle, ) -> CryptoKey<D>
pub(crate) fn new( cx: &mut JSContext, global: &D::GlobalScope, key_type: KeyType, extractable: bool, algorithm: KeyAlgorithmAndDerivatives, usages: Vec<KeyUsage>, handle: Handle, ) -> DomRoot<CryptoKey<D>>
pub(crate) fn algorithm(&self) -> &KeyAlgorithmAndDerivatives
pub(crate) fn usages(&self) -> &[KeyUsage]
pub(crate) fn handle(&self) -> &Handle
Sourcepub(crate) fn ensure_type(&self, expected: KeyType) -> ErrorResult
pub(crate) fn ensure_type(&self, expected: KeyType) -> ErrorResult
Ensure that the [[type]] internal slot of key is same as expected. If the [[type]]
internal slot of key is not same as expected, then throw an InvalidAccessError.
§impl<D: Equivalence> CryptoKey<D>
impl<D: Equivalence> CryptoKey<D>
fn __assert_parent_type(&self)
Trait Implementations§
Source§impl<D> CryptoKeyMethods<D> for CryptoKey<D>where
D: DomTypes,
impl<D> CryptoKeyMethods<D> for CryptoKey<D>where
D: DomTypes,
Source§fn Algorithm(&self, return_value: MutableHandleObject<'_>)
fn Algorithm(&self, return_value: MutableHandleObject<'_>)
Source§fn Usages(&self, return_value: MutableHandleObject<'_>)
fn Usages(&self, return_value: MutableHandleObject<'_>)
Source§impl<D: DomTypes> DomObject for CryptoKey<D>
impl<D: DomTypes> DomObject for CryptoKey<D>
type ReflectorType = <Reflector as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Returns the receiver’s reflector.
§impl<D: DomTypes> IDLInterface for CryptoKey<D>
impl<D: DomTypes> IDLInterface for CryptoKey<D>
§const PROTO_ID: ID = PrototypeList::ID::CryptoKey
const PROTO_ID: ID = PrototypeList::ID::CryptoKey
The concrete type represented by this interface instance.
§const PROTO_FIRST: u16 = 61
const PROTO_FIRST: u16 = 61
First prototype ID in the DFS-ordered range for this interface and its descendants.
§const PROTO_LAST: u16 = 61
const PROTO_LAST: u16 = 61
Last prototype ID in the DFS-ordered range for this interface and its descendants.
Source§impl<D> MallocSizeOf for CryptoKey<D>where
D: MallocSizeOf + DomTypes,
impl<D> MallocSizeOf for CryptoKey<D>where
D: MallocSizeOf + DomTypes,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
§impl<D: Equivalence> MarkedAsSerializableInIdl for CryptoKey<D>
impl<D: Equivalence> MarkedAsSerializableInIdl for CryptoKey<D>
§fn assert_serializable()
fn assert_serializable()
Used to define compile-time assertions about the type implementing this trait.
Source§impl<D: DomTypes> MutDomObject for CryptoKey<D>
impl<D: DomTypes> MutDomObject for CryptoKey<D>
Source§impl<D> Serializable<D> for CryptoKey<D>where
D: Equivalence,
impl<D> Serializable<D> for CryptoKey<D>where
D: Equivalence,
Source§fn deserialize(
cx: &mut JSContext,
owner: &D::GlobalScope,
serialized: Self::Data,
) -> Result<DomRoot<Self>, ()>
fn deserialize( cx: &mut JSContext, owner: &D::GlobalScope, serialized: Self::Data, ) -> Result<DomRoot<Self>, ()>
type Index = CryptoKeyIndex
type Data = SerializableCryptoKey
Source§fn serialized_storage<'a>(
reader: StructuredData<'a, '_>,
) -> &'a mut Option<FxHashMap<CryptoKeyId, Self::Data>>
fn serialized_storage<'a>( reader: StructuredData<'a, '_>, ) -> &'a mut Option<FxHashMap<CryptoKeyId, Self::Data>>
Returns the field of [StructuredDataReader]/[StructuredDataWriter] that
should be used to read/store serialized instances of this type.
Source§impl<D: DomTypes> ToJSValConvertible for CryptoKey<D>
impl<D: DomTypes> ToJSValConvertible for CryptoKey<D>
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
Convert
self to a JSVal. JSAPI failure causes a panic.impl<D: DomTypes> Eq for CryptoKey<D>
Auto Trait Implementations§
impl<D> !Freeze for CryptoKey<D>
impl<D> !RefUnwindSafe for CryptoKey<D>
impl<D> !Send for CryptoKey<D>
impl<D> !Sync for CryptoKey<D>
impl<D> Unpin for CryptoKey<D>where
D: Unpin,
impl<D> UnsafeUnpin for CryptoKey<D>
impl<D> UnwindSafe for CryptoKey<D>where
D: UnwindSafe,
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
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert