#[repr(C)]pub(crate) struct Notification {Show 22 fields
eventtarget: EventTarget,
serviceworker_registration: Option<Dom<ServiceWorkerRegistration>>,
title: DOMString,
body: DOMString,
data: Heap<JSVal>,
dir: NotificationDirection,
image: Option<USVString>,
icon: Option<USVString>,
badge: Option<USVString>,
lang: DOMString,
silent: Option<bool>,
tag: DOMString,
origin: ImmutableOrigin,
vibration_pattern: Vec<u32>,
timestamp: u64,
renotify: bool,
require_interaction: bool,
actions: Vec<Action>,
pending_request_ids: DomRefCell<HashSet<RequestId>>,
image_resource: DomRefCell<Option<Arc<Image>>>,
icon_resource: DomRefCell<Option<Arc<Image>>>,
badge_resource: DomRefCell<Option<Arc<Image>>>,
}
Expand description
Fields§
§eventtarget: EventTarget
§serviceworker_registration: Option<Dom<ServiceWorkerRegistration>>
§title: DOMString
§body: DOMString
§data: Heap<JSVal>
§dir: NotificationDirection
§image: Option<USVString>
§icon: Option<USVString>
§badge: Option<USVString>
§lang: DOMString
§silent: Option<bool>
§tag: DOMString
§origin: ImmutableOrigin
§vibration_pattern: Vec<u32>
§timestamp: u64
§renotify: bool
§require_interaction: bool
§actions: Vec<Action>
§pending_request_ids: DomRefCell<HashSet<RequestId>>
Pending image, icon, badge, action icon resource request’s id
image_resource: DomRefCell<Option<Arc<Image>>>
§icon_resource: DomRefCell<Option<Arc<Image>>>
§badge_resource: DomRefCell<Option<Arc<Image>>>
Implementations§
Source§impl Notification
impl Notification
fn __assert_parent_type(&self)
Source§impl Notification
impl Notification
pub(crate) fn new( global: &GlobalScope, title: DOMString, options: RootedTraceableBox<NotificationOptions>, origin: ImmutableOrigin, base_url: ServoUrl, fallback_timestamp: u64, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> DomRoot<Self>
Sourcefn new_inherited(
global: &GlobalScope,
title: DOMString,
options: &RootedTraceableBox<NotificationOptions>,
origin: ImmutableOrigin,
base_url: ServoUrl,
fallback_timestamp: u64,
) -> Self
fn new_inherited( global: &GlobalScope, title: DOMString, options: &RootedTraceableBox<NotificationOptions>, origin: ImmutableOrigin, base_url: ServoUrl, fallback_timestamp: u64, ) -> Self
partial implementation of https://notifications.spec.whatwg.org/#create-a-notification
Sourcefn to_embedder_notification(&self) -> EmbedderNotification
fn to_embedder_notification(&self) -> EmbedderNotification
Create an embedder_traits::Notification
.
Source§impl Notification
impl Notification
fn build_resource_request(&self, url: &ServoUrl) -> RequestBuilder
fn fetch_and_show_when_ready( &self, request: RequestBuilder, resource_type: ResourceType, )
fn register_image_cache_callback( &self, request_id: RequestId, pending_image_id: PendingImageId, resource_type: ResourceType, )
fn handle_image_cache_response( &self, request_id: RequestId, response: ImageResponse, resource_type: ResourceType, )
fn set_resource_and_show_when_ready( &self, request_id: RequestId, resource_type: &ResourceType, image: Option<Arc<Image>>, )
fn fetch( &self, pending_image_id: PendingImageId, request: RequestBuilder, global: &GlobalScope, )
Trait Implementations§
§impl Castable for Notification
impl Castable for Notification
Source§impl DomObject for Notification
impl DomObject for Notification
Source§impl DomObjectWrap<DomTypeHolder> for Notification
impl DomObjectWrap<DomTypeHolder> for Notification
Source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::GenericBindings::NotificationBinding::Notification_Binding::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::notification::Notification>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::notification::Notification>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::GenericBindings::NotificationBinding::Notification_Binding::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::notification::Notification>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::notification::Notification>>}
Function pointer to the general wrap function type
Source§impl HasParent for Notification
impl HasParent for Notification
Source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
Source§impl IDLInterface for Notification
impl IDLInterface for Notification
Source§impl MallocSizeOf for Notification
impl MallocSizeOf for Notification
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.
Source§impl MutDomObject for Notification
impl MutDomObject for Notification
Source§impl NotificationMethods<DomTypeHolder> for Notification
impl NotificationMethods<DomTypeHolder> for Notification
Source§fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
title: DOMString,
options: RootedTraceableBox<NotificationOptions>,
) -> Fallible<DomRoot<Notification>>
fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, title: DOMString, options: RootedTraceableBox<NotificationOptions>, ) -> Fallible<DomRoot<Notification>>
Source§fn GetPermission(global: &GlobalScope) -> Fallible<NotificationPermission>
fn GetPermission(global: &GlobalScope) -> Fallible<NotificationPermission>
Source§fn RequestPermission(
global: &GlobalScope,
permission_callback: Option<Rc<NotificationPermissionCallback<DomTypeHolder>>>,
can_gc: CanGc,
) -> Rc<Promise>
fn RequestPermission( global: &GlobalScope, permission_callback: Option<Rc<NotificationPermissionCallback<DomTypeHolder>>>, can_gc: CanGc, ) -> Rc<Promise>
Source§fn MaxActions(_global: &GlobalScope) -> u32
fn MaxActions(_global: &GlobalScope) -> u32
Source§fn Dir(&self) -> NotificationDirection
fn Dir(&self) -> NotificationDirection
Source§fn RequireInteraction(&self) -> bool
fn RequireInteraction(&self) -> bool
Source§fn Data(&self, _cx: SafeJSContext, retval: MutableHandleValue<'_>)
fn Data(&self, _cx: SafeJSContext, retval: MutableHandleValue<'_>)
Source§fn Actions(
&self,
cx: SafeJSContext,
can_gc: CanGc,
retval: MutableHandleValue<'_>,
)
fn Actions( &self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue<'_>, )
Source§fn Vibrate(
&self,
cx: SafeJSContext,
can_gc: CanGc,
retval: MutableHandleValue<'_>,
)
fn Vibrate( &self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue<'_>, )
fn GetOnclick(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnclick(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnshow(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnshow(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnerror(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnclose(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnclose(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
Source§impl PartialEq for Notification
impl PartialEq for Notification
Source§impl ToJSValConvertible for Notification
impl ToJSValConvertible for Notification
Source§impl Traceable for Notification
impl Traceable for Notification
impl DerivedFrom<EventTarget> for Notification
impl Eq for Notification
Auto Trait Implementations§
impl !Freeze for Notification
impl !RefUnwindSafe for Notification
impl !Send for Notification
impl !Sync for Notification
impl Unpin for Notification
impl !UnwindSafe for Notification
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<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
Compare self to
key
and return true
if they are equal.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
Compare self to
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>
Creates a filterable data provider with the given name for debugging. Read more
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