Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/dom/webauthn/nsIWebAuthnResult.idl
//
/// `interface nsIWebAuthnRegisterResult : 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 nsIWebAuthnRegisterResult {
vtable: &'static nsIWebAuthnRegisterResultVTable,
/// 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
// 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 nsIWebAuthnRegisterResult.
unsafe impl XpCom for nsIWebAuthnRegisterResult {
const IID: nsIID = nsID(0x0567c384, 0xa728, 0x11ed,
[0x85, 0xf7, 0x03, 0x03, 0x24, 0xa3, 0x70, 0xf0]);
}
// 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 nsIWebAuthnRegisterResult {
#[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 nsIWebAuthnRegisterResult.
// 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 nsIWebAuthnRegisterResultCoerce {
/// Cheaply cast a value of this type from a `nsIWebAuthnRegisterResult`.
fn coerce_from(v: &nsIWebAuthnRegisterResult) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIWebAuthnRegisterResultCoerce for nsIWebAuthnRegisterResult {
#[inline]
fn coerce_from(v: &nsIWebAuthnRegisterResult) -> &Self {
v
}
}
impl nsIWebAuthnRegisterResult {
/// Cast this `nsIWebAuthnRegisterResult` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIWebAuthnRegisterResultCoerce>(&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 nsIWebAuthnRegisterResult {
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> nsIWebAuthnRegisterResultCoerce for T {
#[inline]
fn coerce_from(v: &nsIWebAuthnRegisterResult) -> &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 nsIWebAuthnRegisterResult
// 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 nsIWebAuthnRegisterResultVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute ACString clientDataJSON; */
pub GetClientDataJSON: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aClientDataJSON: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute Array<octet> attestationObject; */
pub GetAttestationObject: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aAttestationObject: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute Array<octet> credentialId; */
pub GetCredentialId: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aCredentialId: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute Array<AString> transports; */
pub GetTransports: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aTransports: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult,
/* readonly attribute boolean hmacCreateSecret; */
pub GetHmacCreateSecret: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aHmacCreateSecret: *mut bool) -> ::nserror::nsresult,
/* [must_use] attribute boolean credPropsRk; */
pub GetCredPropsRk: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aCredPropsRk: *mut bool) -> ::nserror::nsresult,
/* [must_use] attribute boolean credPropsRk; */
pub SetCredPropsRk: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aCredPropsRk: bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute AString authenticatorAttachment; */
pub GetAuthenticatorAttachment: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, aAuthenticatorAttachment: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* boolean hasIdentifyingAttestation (); */
pub HasIdentifyingAttestation: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult, _retval: *mut bool) -> ::nserror::nsresult,
/* void anonymize (); */
pub Anonymize: unsafe extern "system" fn (this: *const nsIWebAuthnRegisterResult) -> ::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 nsIWebAuthnRegisterResult {
/// `readonly attribute ACString clientDataJSON;`
#[inline]
pub unsafe fn GetClientDataJSON(&self, aClientDataJSON: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetClientDataJSON)(self, aClientDataJSON)
}
/// `readonly attribute Array<octet> attestationObject;`
#[inline]
pub unsafe fn GetAttestationObject(&self, aAttestationObject: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetAttestationObject)(self, aAttestationObject)
}
/// `readonly attribute Array<octet> credentialId;`
#[inline]
pub unsafe fn GetCredentialId(&self, aCredentialId: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetCredentialId)(self, aCredentialId)
}
/// `readonly attribute Array<AString> transports;`
#[inline]
pub unsafe fn GetTransports(&self, aTransports: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult {
((*self.vtable).GetTransports)(self, aTransports)
}
/// `readonly attribute boolean hmacCreateSecret;`
#[inline]
pub unsafe fn GetHmacCreateSecret(&self, aHmacCreateSecret: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetHmacCreateSecret)(self, aHmacCreateSecret)
}
/// `[must_use] attribute boolean credPropsRk;`
#[inline]
pub unsafe fn GetCredPropsRk(&self, aCredPropsRk: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetCredPropsRk)(self, aCredPropsRk)
}
/// `[must_use] attribute boolean credPropsRk;`
#[inline]
pub unsafe fn SetCredPropsRk(&self, aCredPropsRk: bool) -> ::nserror::nsresult {
((*self.vtable).SetCredPropsRk)(self, aCredPropsRk)
}
/// `[must_use] readonly attribute AString authenticatorAttachment;`
#[inline]
pub unsafe fn GetAuthenticatorAttachment(&self, aAuthenticatorAttachment: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetAuthenticatorAttachment)(self, aAuthenticatorAttachment)
}
/// `boolean hasIdentifyingAttestation ();`
#[inline]
pub unsafe fn HasIdentifyingAttestation(&self, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).HasIdentifyingAttestation)(self, _retval)
}
/// `void anonymize ();`
#[inline]
pub unsafe fn Anonymize(&self, ) -> ::nserror::nsresult {
((*self.vtable).Anonymize)(self, )
}
}
/// `interface nsIWebAuthnSignResult : 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 nsIWebAuthnSignResult {
vtable: &'static nsIWebAuthnSignResultVTable,
/// 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
// 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 nsIWebAuthnSignResult.
unsafe impl XpCom for nsIWebAuthnSignResult {
const IID: nsIID = nsID(0x05fff816, 0xa728, 0x11ed,
[0xb9, 0xac, 0xff, 0x38, 0xcc, 0x2c, 0x8c, 0x28]);
}
// 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 nsIWebAuthnSignResult {
#[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 nsIWebAuthnSignResult.
// 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 nsIWebAuthnSignResultCoerce {
/// Cheaply cast a value of this type from a `nsIWebAuthnSignResult`.
fn coerce_from(v: &nsIWebAuthnSignResult) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIWebAuthnSignResultCoerce for nsIWebAuthnSignResult {
#[inline]
fn coerce_from(v: &nsIWebAuthnSignResult) -> &Self {
v
}
}
impl nsIWebAuthnSignResult {
/// Cast this `nsIWebAuthnSignResult` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIWebAuthnSignResultCoerce>(&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 nsIWebAuthnSignResult {
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> nsIWebAuthnSignResultCoerce for T {
#[inline]
fn coerce_from(v: &nsIWebAuthnSignResult) -> &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 nsIWebAuthnSignResult
// 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 nsIWebAuthnSignResultVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute ACString clientDataJSON; */
pub GetClientDataJSON: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aClientDataJSON: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute Array<octet> credentialId; */
pub GetCredentialId: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aCredentialId: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute Array<octet> authenticatorData; */
pub GetAuthenticatorData: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aAuthenticatorData: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute Array<octet> signature; */
pub GetSignature: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aSignature: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* [must_use] readonly attribute Array<octet> userHandle; */
pub GetUserHandle: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aUserHandle: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* [must_use] readonly attribute ACString userName; */
pub GetUserName: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aUserName: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* [must_use] attribute boolean usedAppId; */
pub GetUsedAppId: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aUsedAppId: *mut bool) -> ::nserror::nsresult,
/* [must_use] attribute boolean usedAppId; */
pub SetUsedAppId: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aUsedAppId: bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute AString authenticatorAttachment; */
pub GetAuthenticatorAttachment: unsafe extern "system" fn (this: *const nsIWebAuthnSignResult, aAuthenticatorAttachment: *mut ::nsstring::nsAString) -> ::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 nsIWebAuthnSignResult {
/// `readonly attribute ACString clientDataJSON;`
#[inline]
pub unsafe fn GetClientDataJSON(&self, aClientDataJSON: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetClientDataJSON)(self, aClientDataJSON)
}
/// `readonly attribute Array<octet> credentialId;`
#[inline]
pub unsafe fn GetCredentialId(&self, aCredentialId: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetCredentialId)(self, aCredentialId)
}
/// `readonly attribute Array<octet> authenticatorData;`
#[inline]
pub unsafe fn GetAuthenticatorData(&self, aAuthenticatorData: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetAuthenticatorData)(self, aAuthenticatorData)
}
/// `readonly attribute Array<octet> signature;`
#[inline]
pub unsafe fn GetSignature(&self, aSignature: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetSignature)(self, aSignature)
}
/// `[must_use] readonly attribute Array<octet> userHandle;`
#[inline]
pub unsafe fn GetUserHandle(&self, aUserHandle: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetUserHandle)(self, aUserHandle)
}
/// `[must_use] readonly attribute ACString userName;`
#[inline]
pub unsafe fn GetUserName(&self, aUserName: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetUserName)(self, aUserName)
}
/// `[must_use] attribute boolean usedAppId;`
#[inline]
pub unsafe fn GetUsedAppId(&self, aUsedAppId: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetUsedAppId)(self, aUsedAppId)
}
/// `[must_use] attribute boolean usedAppId;`
#[inline]
pub unsafe fn SetUsedAppId(&self, aUsedAppId: bool) -> ::nserror::nsresult {
((*self.vtable).SetUsedAppId)(self, aUsedAppId)
}
/// `[must_use] readonly attribute AString authenticatorAttachment;`
#[inline]
pub unsafe fn GetAuthenticatorAttachment(&self, aAuthenticatorAttachment: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetAuthenticatorAttachment)(self, aAuthenticatorAttachment)
}
}