Copy as Markdown
Other Tools
//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/toolkit/components/extensions/mozIExtensionAPIRequestHandling.idl
//
/// `interface mozIExtensionServiceWorkerInfo : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionServiceWorkerInfo {
vtable: &'static mozIExtensionServiceWorkerInfoVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionServiceWorkerInfo.
unsafe impl XpCom for mozIExtensionServiceWorkerInfo {
const IID: nsIID = nsID(0xe6862533, 0x8844, 0x4207,
[0xa6, 0xab, 0x04, 0x74, 0x8a, 0x29, 0xd8, 0x59]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionServiceWorkerInfo {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionServiceWorkerInfo.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionServiceWorkerInfoCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionServiceWorkerInfo`.
fn coerce_from(v: &mozIExtensionServiceWorkerInfo) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionServiceWorkerInfoCoerce for mozIExtensionServiceWorkerInfo {
#[inline]
fn coerce_from(v: &mozIExtensionServiceWorkerInfo) -> &Self {
v
}
}
impl mozIExtensionServiceWorkerInfo {
/// Cast this `mozIExtensionServiceWorkerInfo` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionServiceWorkerInfoCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionServiceWorkerInfo {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionServiceWorkerInfoCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionServiceWorkerInfo) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionServiceWorkerInfo
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionServiceWorkerInfoVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute nsIPrincipal principal; */
pub GetPrincipal: unsafe extern "system" fn (this: *const mozIExtensionServiceWorkerInfo, aPrincipal: *mut*const nsIPrincipal) -> ::nserror::nsresult,
/* readonly attribute AString scriptURL; */
pub GetScriptURL: unsafe extern "system" fn (this: *const mozIExtensionServiceWorkerInfo, aScriptURL: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* readonly attribute AString clientInfoId; */
pub GetClientInfoId: unsafe extern "system" fn (this: *const mozIExtensionServiceWorkerInfo, aClientInfoId: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* readonly attribute unsigned long long descriptorId; */
pub GetDescriptorId: unsafe extern "system" fn (this: *const mozIExtensionServiceWorkerInfo, aDescriptorId: *mut u64) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionServiceWorkerInfo {
/// `readonly attribute nsIPrincipal principal;`
#[inline]
pub unsafe fn GetPrincipal(&self, aPrincipal: *mut*const nsIPrincipal) -> ::nserror::nsresult {
((*self.vtable).GetPrincipal)(self, aPrincipal)
}
/// `readonly attribute AString scriptURL;`
#[inline]
pub unsafe fn GetScriptURL(&self, aScriptURL: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetScriptURL)(self, aScriptURL)
}
/// `readonly attribute AString clientInfoId;`
#[inline]
pub unsafe fn GetClientInfoId(&self, aClientInfoId: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetClientInfoId)(self, aClientInfoId)
}
/// `readonly attribute unsigned long long descriptorId;`
#[inline]
pub unsafe fn GetDescriptorId(&self, aDescriptorId: *mut u64) -> ::nserror::nsresult {
((*self.vtable).GetDescriptorId)(self, aDescriptorId)
}
}
/// `interface mozIExtensionListenerCallOptions : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionListenerCallOptions {
vtable: &'static mozIExtensionListenerCallOptionsVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionListenerCallOptions.
unsafe impl XpCom for mozIExtensionListenerCallOptions {
const IID: nsIID = nsID(0x876d45db, 0x5c1b, 0x4c9b,
[0x91, 0x48, 0x1c, 0x86, 0xb3, 0x3d, 0x12, 0x0b]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionListenerCallOptions {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionListenerCallOptions.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionListenerCallOptionsCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionListenerCallOptions`.
fn coerce_from(v: &mozIExtensionListenerCallOptions) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionListenerCallOptionsCoerce for mozIExtensionListenerCallOptions {
#[inline]
fn coerce_from(v: &mozIExtensionListenerCallOptions) -> &Self {
v
}
}
impl mozIExtensionListenerCallOptions {
/// Cast this `mozIExtensionListenerCallOptions` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionListenerCallOptionsCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionListenerCallOptions {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionListenerCallOptionsCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionListenerCallOptions) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionListenerCallOptions
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionListenerCallOptionsVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute mozIExtensionListenerCallOptions_APIObjectType apiObjectType; */
pub GetApiObjectType: unsafe extern "system" fn (this: *const mozIExtensionListenerCallOptions, aApiObjectType: *mut u8) -> ::nserror::nsresult,
/* readonly attribute jsval apiObjectDescriptor; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetApiObjectDescriptor: *const ::libc::c_void,
/* readonly attribute boolean apiObjectPrepended; */
pub GetApiObjectPrepended: unsafe extern "system" fn (this: *const mozIExtensionListenerCallOptions, aApiObjectPrepended: *mut bool) -> ::nserror::nsresult,
/* attribute mozIExtensionListenerCallOptions_CallbackType callbackType; */
pub GetCallbackType: unsafe extern "system" fn (this: *const mozIExtensionListenerCallOptions, aCallbackType: *mut u8) -> ::nserror::nsresult,
/* attribute mozIExtensionListenerCallOptions_CallbackType callbackType; */
pub SetCallbackType: unsafe extern "system" fn (this: *const mozIExtensionListenerCallOptions, aCallbackType: u8) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionListenerCallOptions {
pub const NONE: u8 = 0;
pub const RUNTIME_PORT: u8 = 1;
pub const CALLBACK_NONE: u8 = 0;
pub const CALLBACK_SEND_RESPONSE: u8 = 1;
/// `readonly attribute mozIExtensionListenerCallOptions_APIObjectType apiObjectType;`
#[inline]
pub unsafe fn GetApiObjectType(&self, aApiObjectType: *mut u8) -> ::nserror::nsresult {
((*self.vtable).GetApiObjectType)(self, aApiObjectType)
}
/// `readonly attribute jsval apiObjectDescriptor;`
const _GetApiObjectDescriptor: () = ();
/// `readonly attribute boolean apiObjectPrepended;`
#[inline]
pub unsafe fn GetApiObjectPrepended(&self, aApiObjectPrepended: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetApiObjectPrepended)(self, aApiObjectPrepended)
}
/// `attribute mozIExtensionListenerCallOptions_CallbackType callbackType;`
#[inline]
pub unsafe fn GetCallbackType(&self, aCallbackType: *mut u8) -> ::nserror::nsresult {
((*self.vtable).GetCallbackType)(self, aCallbackType)
}
/// `attribute mozIExtensionListenerCallOptions_CallbackType callbackType;`
#[inline]
pub unsafe fn SetCallbackType(&self, aCallbackType: u8) -> ::nserror::nsresult {
((*self.vtable).SetCallbackType)(self, aCallbackType)
}
}
/// `interface mozIExtensionEventListener : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionEventListener {
vtable: &'static mozIExtensionEventListenerVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionEventListener.
unsafe impl XpCom for mozIExtensionEventListener {
const IID: nsIID = nsID(0xe68e3c19, 0x1b35, 0x4112,
[0x8f, 0xaa, 0x5c, 0x5b, 0x84, 0x08, 0x6a, 0x5b]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionEventListener {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionEventListener.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionEventListenerCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionEventListener`.
fn coerce_from(v: &mozIExtensionEventListener) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionEventListenerCoerce for mozIExtensionEventListener {
#[inline]
fn coerce_from(v: &mozIExtensionEventListener) -> &Self {
v
}
}
impl mozIExtensionEventListener {
/// Cast this `mozIExtensionEventListener` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionEventListenerCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionEventListener {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionEventListenerCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionEventListener) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionEventListener
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionEventListenerVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* [can_run_script,implicit_jscontext] Promise callListener (in Array<jsval> args, [optional] in mozIExtensionListenerCallOptions listenerCallOptions); */
/// Unable to generate binding because `special type jsval unsupported`
pub CallListener: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionEventListener {
/// `[can_run_script,implicit_jscontext] Promise callListener (in Array<jsval> args, [optional] in mozIExtensionListenerCallOptions listenerCallOptions);`
const _CallListener: () = ();
}
/// `interface mozIExtensionAPIRequest : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionAPIRequest {
vtable: &'static mozIExtensionAPIRequestVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionAPIRequest.
unsafe impl XpCom for mozIExtensionAPIRequest {
const IID: nsIID = nsID(0x0fee1c8f, 0xe363, 0x46a6,
[0xbd, 0x0c, 0xd3, 0xc3, 0x33, 0x8e, 0x25, 0x34]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionAPIRequest {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionAPIRequest.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionAPIRequestCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionAPIRequest`.
fn coerce_from(v: &mozIExtensionAPIRequest) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionAPIRequestCoerce for mozIExtensionAPIRequest {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequest) -> &Self {
v
}
}
impl mozIExtensionAPIRequest {
/// Cast this `mozIExtensionAPIRequest` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionAPIRequestCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionAPIRequest {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionAPIRequestCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequest) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionAPIRequest
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionAPIRequestVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* AUTF8String toString (); */
pub ToString: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute AUTF8String requestType; */
pub GetRequestType: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aRequestType: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute AUTF8String apiNamespace; */
pub GetApiNamespace: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aApiNamespace: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute AUTF8String apiName; */
pub GetApiName: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aApiName: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute AUTF8String apiObjectType; */
pub GetApiObjectType: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aApiObjectType: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute AUTF8String apiObjectId; */
pub GetApiObjectId: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aApiObjectId: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* [implicit_jscontext] readonly attribute jsval args; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetArgs: *const ::libc::c_void,
/* [implicit_jscontext] attribute jsval normalizedArgs; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetNormalizedArgs: *const ::libc::c_void,
/* [implicit_jscontext] attribute jsval normalizedArgs; */
/// Unable to generate binding because `special type jsval unsupported`
pub SetNormalizedArgs: *const ::libc::c_void,
/* [implicit_jscontext] readonly attribute jsval callerSavedFrame; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetCallerSavedFrame: *const ::libc::c_void,
/* readonly attribute mozIExtensionServiceWorkerInfo serviceWorkerInfo; */
pub GetServiceWorkerInfo: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aServiceWorkerInfo: *mut *const mozIExtensionServiceWorkerInfo) -> ::nserror::nsresult,
/* readonly attribute mozIExtensionEventListener eventListener; */
pub GetEventListener: unsafe extern "system" fn (this: *const mozIExtensionAPIRequest, aEventListener: *mut *const mozIExtensionEventListener) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionAPIRequest {
pub const CALL_FUNCTION: u8 = 0;
pub const CALL_FUNCTION_NO_RETURN: u8 = 1;
pub const CALL_FUNCTION_ASYNC: u8 = 2;
pub const ADD_LISTENER: u8 = 3;
pub const REMOVE_LISTENER: u8 = 4;
pub const GET_PROPERTY: u8 = 5;
/// `AUTF8String toString ();`
#[inline]
pub unsafe fn ToString(&self, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).ToString)(self, _retval)
}
/// `readonly attribute AUTF8String requestType;`
#[inline]
pub unsafe fn GetRequestType(&self, aRequestType: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetRequestType)(self, aRequestType)
}
/// `readonly attribute AUTF8String apiNamespace;`
#[inline]
pub unsafe fn GetApiNamespace(&self, aApiNamespace: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetApiNamespace)(self, aApiNamespace)
}
/// `readonly attribute AUTF8String apiName;`
#[inline]
pub unsafe fn GetApiName(&self, aApiName: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetApiName)(self, aApiName)
}
/// `readonly attribute AUTF8String apiObjectType;`
#[inline]
pub unsafe fn GetApiObjectType(&self, aApiObjectType: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetApiObjectType)(self, aApiObjectType)
}
/// `readonly attribute AUTF8String apiObjectId;`
#[inline]
pub unsafe fn GetApiObjectId(&self, aApiObjectId: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetApiObjectId)(self, aApiObjectId)
}
/// `[implicit_jscontext] readonly attribute jsval args;`
const _GetArgs: () = ();
/// `[implicit_jscontext] attribute jsval normalizedArgs;`
const _GetNormalizedArgs: () = ();
/// `[implicit_jscontext] attribute jsval normalizedArgs;`
const _SetNormalizedArgs: () = ();
/// `[implicit_jscontext] readonly attribute jsval callerSavedFrame;`
const _GetCallerSavedFrame: () = ();
/// `readonly attribute mozIExtensionServiceWorkerInfo serviceWorkerInfo;`
#[inline]
pub unsafe fn GetServiceWorkerInfo(&self, aServiceWorkerInfo: *mut *const mozIExtensionServiceWorkerInfo) -> ::nserror::nsresult {
((*self.vtable).GetServiceWorkerInfo)(self, aServiceWorkerInfo)
}
/// `readonly attribute mozIExtensionEventListener eventListener;`
#[inline]
pub unsafe fn GetEventListener(&self, aEventListener: *mut *const mozIExtensionEventListener) -> ::nserror::nsresult {
((*self.vtable).GetEventListener)(self, aEventListener)
}
}
/// `interface mozIExtensionAPIRequestResult : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionAPIRequestResult {
vtable: &'static mozIExtensionAPIRequestResultVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionAPIRequestResult.
unsafe impl XpCom for mozIExtensionAPIRequestResult {
const IID: nsIID = nsID(0x59fd4097, 0xd88e, 0x40fd,
[0x86, 0x64, 0xfe, 0xdd, 0x8a, 0xb6, 0x7a, 0xb6]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionAPIRequestResult {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionAPIRequestResult.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionAPIRequestResultCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionAPIRequestResult`.
fn coerce_from(v: &mozIExtensionAPIRequestResult) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionAPIRequestResultCoerce for mozIExtensionAPIRequestResult {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequestResult) -> &Self {
v
}
}
impl mozIExtensionAPIRequestResult {
/// Cast this `mozIExtensionAPIRequestResult` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionAPIRequestResultCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionAPIRequestResult {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionAPIRequestResultCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequestResult) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionAPIRequestResult
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionAPIRequestResultVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute mozIExtensionAPIRequestResult_ResultType type; */
pub GetType: unsafe extern "system" fn (this: *const mozIExtensionAPIRequestResult, aType: *mut u8) -> ::nserror::nsresult,
/* readonly attribute jsval value; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetValue: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionAPIRequestResult {
pub const RETURN_VALUE: u8 = 0;
pub const EXTENSION_ERROR: u8 = 1;
/// `readonly attribute mozIExtensionAPIRequestResult_ResultType type;`
#[inline]
pub unsafe fn GetType(&self, aType: *mut u8) -> ::nserror::nsresult {
((*self.vtable).GetType)(self, aType)
}
/// `readonly attribute jsval value;`
const _GetValue: () = ();
}
/// `interface mozIExtensionAPIRequestHandler : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct mozIExtensionAPIRequestHandler {
vtable: &'static mozIExtensionAPIRequestHandlerVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// introduced by https://github.com/llvm/llvm-project/commit/01859da84bad95fd51d6a03b08b60c660e642a4f
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for mozIExtensionAPIRequestHandler.
unsafe impl XpCom for mozIExtensionAPIRequestHandler {
const IID: nsIID = nsID(0x0c61bd33, 0x0557, 0x43a2,
[0x94, 0x97, 0x96, 0xc4, 0x49, 0xf3, 0x9e, 0x33]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for mozIExtensionAPIRequestHandler {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from mozIExtensionAPIRequestHandler.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait mozIExtensionAPIRequestHandlerCoerce {
/// Cheaply cast a value of this type from a `mozIExtensionAPIRequestHandler`.
fn coerce_from(v: &mozIExtensionAPIRequestHandler) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl mozIExtensionAPIRequestHandlerCoerce for mozIExtensionAPIRequestHandler {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequestHandler) -> &Self {
v
}
}
impl mozIExtensionAPIRequestHandler {
/// Cast this `mozIExtensionAPIRequestHandler` to one of its base interfaces.
#[inline]
pub fn coerce<T: mozIExtensionAPIRequestHandlerCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for mozIExtensionAPIRequestHandler {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> mozIExtensionAPIRequestHandlerCoerce for T {
#[inline]
fn coerce_from(v: &mozIExtensionAPIRequestHandler) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every mozIExtensionAPIRequestHandler
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct mozIExtensionAPIRequestHandlerVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* void handleAPIRequest (in nsISupports extension, in mozIExtensionAPIRequest apiRequest, [retval, optional] out mozIExtensionAPIRequestResult apiRequestResult); */
pub HandleAPIRequest: unsafe extern "system" fn (this: *const mozIExtensionAPIRequestHandler, extension: *const nsISupports, apiRequest: *const mozIExtensionAPIRequest, apiRequestResult: *mut *const mozIExtensionAPIRequestResult) -> ::nserror::nsresult,
/* void initExtensionWorker (in nsISupports extension, in mozIExtensionServiceWorkerInfo serviceWorkerInfo); */
pub InitExtensionWorker: unsafe extern "system" fn (this: *const mozIExtensionAPIRequestHandler, extension: *const nsISupports, serviceWorkerInfo: *const mozIExtensionServiceWorkerInfo) -> ::nserror::nsresult,
/* void onExtensionWorkerLoaded (in nsISupports extension, in unsigned long long serviceWorkerDescriptorId); */
pub OnExtensionWorkerLoaded: unsafe extern "system" fn (this: *const mozIExtensionAPIRequestHandler, extension: *const nsISupports, serviceWorkerDescriptorId: u64) -> ::nserror::nsresult,
/* void onExtensionWorkerDestroyed (in nsISupports extension, in unsigned long long serviceWorkerDescriptorId); */
pub OnExtensionWorkerDestroyed: unsafe extern "system" fn (this: *const mozIExtensionAPIRequestHandler, extension: *const nsISupports, serviceWorkerDescriptorId: u64) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl mozIExtensionAPIRequestHandler {
/// ```text
/// /**
/// * Handle an API request originated from the WebExtensions webidl API
/// * bindings.
/// *
/// * @param extension An instance of the WebExtensionPolicy webidl interface.
/// * @param apiRequest An instance of the mozIExtensionAPIRequest xpcom interface.
/// *
/// * @return mozIExtensionAPIRequestResult
/// * JS value returned by the API request handler, may contain a value
/// * (the result of the API call or a WebIDL dictionary that is used to
/// * initialize WebIDL-based API object, e.g. ExtensionPort) or
/// * an Error to be throw on the thread that originated the request.
/// */
/// ```
///
/// `void handleAPIRequest (in nsISupports extension, in mozIExtensionAPIRequest apiRequest, [retval, optional] out mozIExtensionAPIRequestResult apiRequestResult);`
#[inline]
pub unsafe fn HandleAPIRequest(&self, extension: *const nsISupports, apiRequest: *const mozIExtensionAPIRequest, apiRequestResult: *mut *const mozIExtensionAPIRequestResult) -> ::nserror::nsresult {
((*self.vtable).HandleAPIRequest)(self, extension, apiRequest, apiRequestResult)
}
/// ```text
/// /**
/// * A method called when an extension background service worker is initialized and
/// * ready to execute its main script.
/// *
/// * @param extension An instance of the WebExtensionPolicy webidl interface.
/// * @param serviceWorkerInfo
/// */
/// ```
///
/// `void initExtensionWorker (in nsISupports extension, in mozIExtensionServiceWorkerInfo serviceWorkerInfo);`
#[inline]
pub unsafe fn InitExtensionWorker(&self, extension: *const nsISupports, serviceWorkerInfo: *const mozIExtensionServiceWorkerInfo) -> ::nserror::nsresult {
((*self.vtable).InitExtensionWorker)(self, extension, serviceWorkerInfo)
}
/// ```text
/// /**
/// * A method called when an extension background service worker has loaded its
/// * main script.
/// *
/// * @param extension An instance of the WebExtensionPolicy webidl interface.
/// * @param serviceWorkerDescriptorId
/// */
/// ```
///
/// `void onExtensionWorkerLoaded (in nsISupports extension, in unsigned long long serviceWorkerDescriptorId);`
#[inline]
pub unsafe fn OnExtensionWorkerLoaded(&self, extension: *const nsISupports, serviceWorkerDescriptorId: u64) -> ::nserror::nsresult {
((*self.vtable).OnExtensionWorkerLoaded)(self, extension, serviceWorkerDescriptorId)
}
/// ```text
/// /**
/// * A method called when an extension background service worker is destroyed.
/// *
/// * @param extension An instance of the WebExtensionPolicy webidl interface.
/// * @param serviceWorkerDescriptorId
/// */
/// ```
///
/// `void onExtensionWorkerDestroyed (in nsISupports extension, in unsigned long long serviceWorkerDescriptorId);`
#[inline]
pub unsafe fn OnExtensionWorkerDestroyed(&self, extension: *const nsISupports, serviceWorkerDescriptorId: u64) -> ::nserror::nsresult {
((*self.vtable).OnExtensionWorkerDestroyed)(self, extension, serviceWorkerDescriptorId)
}
}