#[repr(C)]pub(crate) struct SubtleCrypto {
reflector_: Reflector,
rng: DomRefCell<ServoRng>,
}
Fields§
§reflector_: Reflector
§rng: DomRefCell<ServoRng>
Implementations§
Source§impl SubtleCrypto
impl SubtleCrypto
fn __assert_parent_type(&self)
Source§impl SubtleCrypto
impl SubtleCrypto
fn new_inherited() -> SubtleCrypto
pub(crate) fn new(global: &GlobalScope, can_gc: CanGc) -> DomRoot<SubtleCrypto>
Sourcefn resolve_promise_with_data(&self, promise: Rc<Promise>, data: Vec<u8>)
fn resolve_promise_with_data(&self, promise: Rc<Promise>, data: Vec<u8>)
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of creating an ArrayBuffer in realm, containing data. If it fails to create buffer source, reject promise with a JSFailedError.
Sourcefn resolve_promise_with_jwk(&self, promise: Rc<Promise>, jwk: Box<JsonWebKey>)
fn resolve_promise_with_jwk(&self, promise: Rc<Promise>, jwk: Box<JsonWebKey>)
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of converting a JsonWebKey dictionary to an ECMAScript Object in realm, as defined by [WebIDL].
Sourcefn resolve_promise_with_key(
&self,
promise: Rc<Promise>,
key: DomRoot<CryptoKey>,
)
fn resolve_promise_with_key( &self, promise: Rc<Promise>, key: DomRoot<CryptoKey>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with a CryptoKey.
Sourcefn resolve_promise_with_bool(&self, promise: Rc<Promise>, result: bool)
fn resolve_promise_with_bool(&self, promise: Rc<Promise>, result: bool)
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with a bool value.
Sourcefn reject_promise_with_error(&self, promise: Rc<Promise>, error: Error)
fn reject_promise_with_error(&self, promise: Rc<Promise>, error: Error)
Queue a global task on the crypto task source, given realm’s global object, to reject promise with an error.
Trait Implementations§
Source§impl DomObject for SubtleCrypto
impl DomObject for SubtleCrypto
Source§impl DomObjectWrap<DomTypeHolder> for SubtleCrypto
impl DomObjectWrap<DomTypeHolder> for SubtleCrypto
Source§const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::SubtleCryptoBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::subtlecrypto::SubtleCrypto>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::subtlecrypto::SubtleCrypto>>}
const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::SubtleCryptoBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::subtlecrypto::SubtleCrypto>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::subtlecrypto::SubtleCrypto>>}
Source§impl HasParent for SubtleCrypto
impl HasParent for SubtleCrypto
Source§impl IDLInterface for SubtleCrypto
impl IDLInterface for SubtleCrypto
Source§impl MallocSizeOf for SubtleCrypto
impl MallocSizeOf for SubtleCrypto
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for SubtleCrypto
impl MutDomObject for SubtleCrypto
Source§impl PartialEq for SubtleCrypto
impl PartialEq for SubtleCrypto
Source§impl SubtleCryptoMethods<DomTypeHolder> for SubtleCrypto
impl SubtleCryptoMethods<DomTypeHolder> for SubtleCrypto
Source§fn Encrypt(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn Encrypt( &self, cx: JSContext, algorithm: AlgorithmIdentifier, key: &CryptoKey, data: ArrayBufferViewOrArrayBuffer, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn Decrypt(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn Decrypt( &self, cx: JSContext, algorithm: AlgorithmIdentifier, key: &CryptoKey, data: ArrayBufferViewOrArrayBuffer, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn Sign(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn Sign( &self, cx: JSContext, algorithm: AlgorithmIdentifier, key: &CryptoKey, data: ArrayBufferViewOrArrayBuffer, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn Verify(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
key: &CryptoKey,
signature: ArrayBufferViewOrArrayBuffer,
data: ArrayBufferViewOrArrayBuffer,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn Verify( &self, cx: JSContext, algorithm: AlgorithmIdentifier, key: &CryptoKey, signature: ArrayBufferViewOrArrayBuffer, data: ArrayBufferViewOrArrayBuffer, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn Digest(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
data: ArrayBufferViewOrArrayBuffer,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn Digest( &self, cx: JSContext, algorithm: AlgorithmIdentifier, data: ArrayBufferViewOrArrayBuffer, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn GenerateKey(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
extractable: bool,
key_usages: Vec<KeyUsage>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn GenerateKey( &self, cx: JSContext, algorithm: AlgorithmIdentifier, extractable: bool, key_usages: Vec<KeyUsage>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn DeriveKey(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
base_key: &CryptoKey,
derived_key_type: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn DeriveKey( &self, cx: JSContext, algorithm: AlgorithmIdentifier, base_key: &CryptoKey, derived_key_type: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn DeriveBits(
&self,
cx: JSContext,
algorithm: AlgorithmIdentifier,
base_key: &CryptoKey,
length: Option<u32>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn DeriveBits( &self, cx: JSContext, algorithm: AlgorithmIdentifier, base_key: &CryptoKey, length: Option<u32>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn ImportKey(
&self,
cx: JSContext,
format: KeyFormat,
key_data: ArrayBufferViewOrArrayBufferOrJsonWebKey,
algorithm: AlgorithmIdentifier,
extractable: bool,
key_usages: Vec<KeyUsage>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn ImportKey( &self, cx: JSContext, format: KeyFormat, key_data: ArrayBufferViewOrArrayBufferOrJsonWebKey, algorithm: AlgorithmIdentifier, extractable: bool, key_usages: Vec<KeyUsage>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn ExportKey(
&self,
format: KeyFormat,
key: &CryptoKey,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn ExportKey( &self, format: KeyFormat, key: &CryptoKey, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn WrapKey(
&self,
cx: JSContext,
format: KeyFormat,
key: &CryptoKey,
wrapping_key: &CryptoKey,
algorithm: AlgorithmIdentifier,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn WrapKey( &self, cx: JSContext, format: KeyFormat, key: &CryptoKey, wrapping_key: &CryptoKey, algorithm: AlgorithmIdentifier, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn UnwrapKey(
&self,
cx: JSContext,
format: KeyFormat,
wrapped_key: ArrayBufferViewOrArrayBuffer,
unwrapping_key: &CryptoKey,
algorithm: AlgorithmIdentifier,
unwrapped_key_algorithm: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn UnwrapKey( &self, cx: JSContext, format: KeyFormat, wrapped_key: ArrayBufferViewOrArrayBuffer, unwrapping_key: &CryptoKey, algorithm: AlgorithmIdentifier, unwrapped_key_algorithm: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
Source§impl ToJSValConvertible for SubtleCrypto
impl ToJSValConvertible for SubtleCrypto
Source§impl Traceable for SubtleCrypto
impl Traceable for SubtleCrypto
impl Eq for SubtleCrypto
Auto Trait Implementations§
impl !Freeze for SubtleCrypto
impl !RefUnwindSafe for SubtleCrypto
impl !Send for SubtleCrypto
impl !Sync for SubtleCrypto
impl Unpin for SubtleCrypto
impl UnwindSafe for SubtleCrypto
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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
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
Node
s 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§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
key
and return true
if they are equal.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
key
and return true
if they are equal.Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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>
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>
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 more