Generated file

Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/security/manager/ssl/nsICtapCableChannel.idl
//
/// `interface nsICtapCableChannel : nsISupports`
///
/// ```text
/// /**
/// * CTAP caBLE/Hybrid post-handshake interface.
/// *
/// * Messages must be decrypted in the same order that they were encrypted.
/// *
/// */
/// ```
///
// 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 nsICtapCableChannel {
vtable: &'static nsICtapCableChannelVTable,
/// 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 nsICtapCableChannel.
unsafe impl XpCom for nsICtapCableChannel {
const IID: nsIID = nsID(0x44147a85, 0x3d83, 0x4fa5,
[0xb1, 0x65, 0xbb, 0x1f, 0x33, 0x4b, 0x1e, 0xa4]);
}
// 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 nsICtapCableChannel {
#[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 nsICtapCableChannel.
// 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 nsICtapCableChannelCoerce {
/// Cheaply cast a value of this type from a `nsICtapCableChannel`.
fn coerce_from(v: &nsICtapCableChannel) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsICtapCableChannelCoerce for nsICtapCableChannel {
#[inline]
fn coerce_from(v: &nsICtapCableChannel) -> &Self {
v
}
}
impl nsICtapCableChannel {
/// Cast this `nsICtapCableChannel` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsICtapCableChannelCoerce>(&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 nsICtapCableChannel {
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> nsICtapCableChannelCoerce for T {
#[inline]
fn coerce_from(v: &nsICtapCableChannel) -> &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 nsICtapCableChannel
// 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 nsICtapCableChannelVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute boolean hasKeys; */
pub GetHasKeys: unsafe extern "system" fn (this: *const nsICtapCableChannel, aHasKeys: *mut bool) -> ::nserror::nsresult,
/* void initializeKeys (in Array<octet> aDecryptKey, in Array<octet> aEncryptKey); */
pub InitializeKeys: unsafe extern "system" fn (this: *const nsICtapCableChannel, aDecryptKey: *const thin_vec::ThinVec<u8>, aEncryptKey: *const thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* Array<octet> encrypt (in Array<octet> aPlainText); */
pub Encrypt: unsafe extern "system" fn (this: *const nsICtapCableChannel, aPlainText: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* Array<octet> decrypt (in Array<octet> aCipherText); */
pub Decrypt: unsafe extern "system" fn (this: *const nsICtapCableChannel, aCipherText: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<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 nsICtapCableChannel {
/// ```text
/// /**
/// * `true` if this channel has been initialized with decryption and
/// * encryption keys.
/// */
/// ```
///
/// `readonly attribute boolean hasKeys;`
#[inline]
pub unsafe fn GetHasKeys(&self, aHasKeys: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetHasKeys)(self, aHasKeys)
}
/// ```text
/// /**
/// * Intialize this channel with new decryption and encryption keys (derived
/// * from a Noise handshake), and reset both nonces to 0.
/// *
/// * Both keys must be exactly 32 bytes long.
/// */
/// ```
///
/// `void initializeKeys (in Array<octet> aDecryptKey, in Array<octet> aEncryptKey);`
#[inline]
pub unsafe fn InitializeKeys(&self, aDecryptKey: *const thin_vec::ThinVec<u8>, aEncryptKey: *const thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).InitializeKeys)(self, aDecryptKey, aEncryptKey)
}
/// ```text
/// /**
/// * Encrypt plaintext using this channel's encryption key, and increment the
/// * encryption nonce.
/// *
/// * Returns an error if the channel does not have encryption keys.
/// */
/// ```
///
/// `Array<octet> encrypt (in Array<octet> aPlainText);`
#[inline]
pub unsafe fn Encrypt(&self, aPlainText: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).Encrypt)(self, aPlainText, _retval)
}
/// ```text
/// /**
/// * Decrypt ciphertext using this channel's decryption key and nonce. On
/// * successful decryption, increment the decryption nonce.
/// *
/// * Returns an error if the channel does not have decryptionkeys, or the data
/// * cannot be decrypted.
/// */
/// ```
///
/// `Array<octet> decrypt (in Array<octet> aCipherText);`
#[inline]
pub unsafe fn Decrypt(&self, aCipherText: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).Decrypt)(self, aCipherText, _retval)
}
}
/// `interface nsICtapCableInitiator : nsICtapCableChannel`
///
// 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 nsICtapCableInitiator {
vtable: &'static nsICtapCableInitiatorVTable,
/// 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 nsICtapCableInitiator.
unsafe impl XpCom for nsICtapCableInitiator {
const IID: nsIID = nsID(0x158a8333, 0xa0ae, 0x487b,
[0xae, 0x1c, 0x48, 0xfa, 0xb5, 0xbe, 0x8c, 0xd9]);
}
// 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 nsICtapCableInitiator {
#[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 nsICtapCableInitiator.
// 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 nsICtapCableInitiatorCoerce {
/// Cheaply cast a value of this type from a `nsICtapCableInitiator`.
fn coerce_from(v: &nsICtapCableInitiator) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsICtapCableInitiatorCoerce for nsICtapCableInitiator {
#[inline]
fn coerce_from(v: &nsICtapCableInitiator) -> &Self {
v
}
}
impl nsICtapCableInitiator {
/// Cast this `nsICtapCableInitiator` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsICtapCableInitiatorCoerce>(&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 nsICtapCableInitiator {
type Target = nsICtapCableChannel;
#[inline]
fn deref(&self) -> &nsICtapCableChannel {
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: nsICtapCableChannelCoerce> nsICtapCableInitiatorCoerce for T {
#[inline]
fn coerce_from(v: &nsICtapCableInitiator) -> &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 nsICtapCableInitiator
// 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 nsICtapCableInitiatorVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsICtapCableChannelVTable,
/* readonly attribute Array<octet> handshakeHash; */
pub GetHandshakeHash: unsafe extern "system" fn (this: *const nsICtapCableInitiator, aHandshakeHash: *mut thin_vec::ThinVec<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 nsICtapCableInitiator {
/// ```text
/// /**
/// * Handshake hash, used for Noise channel binding.
/// *
/// */
/// ```
///
/// `readonly attribute Array<octet> handshakeHash;`
#[inline]
pub unsafe fn GetHandshakeHash(&self, aHandshakeHash: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetHandshakeHash)(self, aHandshakeHash)
}
}
/// `interface nsICtapCableResponder : nsICtapCableChannel`
///
// 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 nsICtapCableResponder {
vtable: &'static nsICtapCableResponderVTable,
/// 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 nsICtapCableResponder.
unsafe impl XpCom for nsICtapCableResponder {
const IID: nsIID = nsID(0x2dbfbc2d, 0x33ac, 0x4573,
[0x96, 0x3e, 0x5c, 0xdf, 0x3d, 0x5a, 0x93, 0xba]);
}
// 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 nsICtapCableResponder {
#[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 nsICtapCableResponder.
// 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 nsICtapCableResponderCoerce {
/// Cheaply cast a value of this type from a `nsICtapCableResponder`.
fn coerce_from(v: &nsICtapCableResponder) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsICtapCableResponderCoerce for nsICtapCableResponder {
#[inline]
fn coerce_from(v: &nsICtapCableResponder) -> &Self {
v
}
}
impl nsICtapCableResponder {
/// Cast this `nsICtapCableResponder` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsICtapCableResponderCoerce>(&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 nsICtapCableResponder {
type Target = nsICtapCableChannel;
#[inline]
fn deref(&self) -> &nsICtapCableChannel {
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: nsICtapCableChannelCoerce> nsICtapCableResponderCoerce for T {
#[inline]
fn coerce_from(v: &nsICtapCableResponder) -> &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 nsICtapCableResponder
// 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 nsICtapCableResponderVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsICtapCableChannelVTable,
/* readonly attribute Array<octet> handshakeHash; */
pub GetHandshakeHash: unsafe extern "system" fn (this: *const nsICtapCableResponder, aHandshakeHash: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute Array<octet> responseMessage; */
pub GetResponseMessage: unsafe extern "system" fn (this: *const nsICtapCableResponder, aResponseMessage: *mut thin_vec::ThinVec<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 nsICtapCableResponder {
/// ```text
/// /**
/// * Handshake hash, used for Noise channel binding.
/// *
/// */
/// ```
///
/// `readonly attribute Array<octet> handshakeHash;`
#[inline]
pub unsafe fn GetHandshakeHash(&self, aHandshakeHash: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetHandshakeHash)(self, aHandshakeHash)
}
/// ```text
/// /**
/// * Response message to send to the initiator to complete the handshake.
/// */
/// ```
///
/// `readonly attribute Array<octet> responseMessage;`
#[inline]
pub unsafe fn GetResponseMessage(&self, aResponseMessage: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetResponseMessage)(self, aResponseMessage)
}
}