Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/netwerk/protocol/http/nsIObliviousHttp.idl
//
/// `interface nsIObliviousHttpClientResponse : 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 nsIObliviousHttpClientResponse {
vtable: &'static nsIObliviousHttpClientResponseVTable,
/// 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 nsIObliviousHttpClientResponse.
unsafe impl XpCom for nsIObliviousHttpClientResponse {
const IID: nsIID = nsID(0xf2a4aaa4, 0x046a, 0x439e,
[0xbe, 0xef, 0x89, 0x3b, 0x15, 0xa9, 0x0c, 0xff]);
}
// 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 nsIObliviousHttpClientResponse {
#[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 nsIObliviousHttpClientResponse.
// 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 nsIObliviousHttpClientResponseCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttpClientResponse`.
fn coerce_from(v: &nsIObliviousHttpClientResponse) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpClientResponseCoerce for nsIObliviousHttpClientResponse {
#[inline]
fn coerce_from(v: &nsIObliviousHttpClientResponse) -> &Self {
v
}
}
impl nsIObliviousHttpClientResponse {
/// Cast this `nsIObliviousHttpClientResponse` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpClientResponseCoerce>(&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 nsIObliviousHttpClientResponse {
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> nsIObliviousHttpClientResponseCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttpClientResponse) -> &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 nsIObliviousHttpClientResponse
// 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 nsIObliviousHttpClientResponseVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* Array<octet> decapsulate (in Array<octet> encResponse); */
pub Decapsulate: unsafe extern "system" fn (this: *const nsIObliviousHttpClientResponse, encResponse: *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 nsIObliviousHttpClientResponse {
/// `Array<octet> decapsulate (in Array<octet> encResponse);`
#[inline]
pub unsafe fn Decapsulate(&self, encResponse: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).Decapsulate)(self, encResponse, _retval)
}
}
/// `interface nsIObliviousHttpClientRequest : 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 nsIObliviousHttpClientRequest {
vtable: &'static nsIObliviousHttpClientRequestVTable,
/// 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 nsIObliviousHttpClientRequest.
unsafe impl XpCom for nsIObliviousHttpClientRequest {
const IID: nsIID = nsID(0x403af7f9, 0x4a76, 0x49fc,
[0xa6, 0x22, 0x38, 0xd6, 0xba, 0x3e, 0xe4, 0x96]);
}
// 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 nsIObliviousHttpClientRequest {
#[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 nsIObliviousHttpClientRequest.
// 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 nsIObliviousHttpClientRequestCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttpClientRequest`.
fn coerce_from(v: &nsIObliviousHttpClientRequest) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpClientRequestCoerce for nsIObliviousHttpClientRequest {
#[inline]
fn coerce_from(v: &nsIObliviousHttpClientRequest) -> &Self {
v
}
}
impl nsIObliviousHttpClientRequest {
/// Cast this `nsIObliviousHttpClientRequest` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpClientRequestCoerce>(&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 nsIObliviousHttpClientRequest {
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> nsIObliviousHttpClientRequestCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttpClientRequest) -> &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 nsIObliviousHttpClientRequest
// 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 nsIObliviousHttpClientRequestVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute Array<octet> encRequest; */
pub GetEncRequest: unsafe extern "system" fn (this: *const nsIObliviousHttpClientRequest, aEncRequest: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* readonly attribute nsIObliviousHttpClientResponse response; */
pub GetResponse: unsafe extern "system" fn (this: *const nsIObliviousHttpClientRequest, aResponse: *mut *const nsIObliviousHttpClientResponse) -> ::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 nsIObliviousHttpClientRequest {
/// `readonly attribute Array<octet> encRequest;`
#[inline]
pub unsafe fn GetEncRequest(&self, aEncRequest: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetEncRequest)(self, aEncRequest)
}
/// `readonly attribute nsIObliviousHttpClientResponse response;`
#[inline]
pub unsafe fn GetResponse(&self, aResponse: *mut *const nsIObliviousHttpClientResponse) -> ::nserror::nsresult {
((*self.vtable).GetResponse)(self, aResponse)
}
}
/// `interface nsIObliviousHttpServerResponse : 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 nsIObliviousHttpServerResponse {
vtable: &'static nsIObliviousHttpServerResponseVTable,
/// 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 nsIObliviousHttpServerResponse.
unsafe impl XpCom for nsIObliviousHttpServerResponse {
const IID: nsIID = nsID(0x105deb62, 0x45b4, 0x407a,
[0xb3, 0x30, 0x55, 0x04, 0x33, 0x27, 0x91, 0x11]);
}
// 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 nsIObliviousHttpServerResponse {
#[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 nsIObliviousHttpServerResponse.
// 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 nsIObliviousHttpServerResponseCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttpServerResponse`.
fn coerce_from(v: &nsIObliviousHttpServerResponse) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpServerResponseCoerce for nsIObliviousHttpServerResponse {
#[inline]
fn coerce_from(v: &nsIObliviousHttpServerResponse) -> &Self {
v
}
}
impl nsIObliviousHttpServerResponse {
/// Cast this `nsIObliviousHttpServerResponse` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpServerResponseCoerce>(&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 nsIObliviousHttpServerResponse {
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> nsIObliviousHttpServerResponseCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttpServerResponse) -> &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 nsIObliviousHttpServerResponse
// 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 nsIObliviousHttpServerResponseVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute Array<octet> request; */
pub GetRequest: unsafe extern "system" fn (this: *const nsIObliviousHttpServerResponse, aRequest: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* Array<octet> encapsulate (in Array<octet> response); */
pub Encapsulate: unsafe extern "system" fn (this: *const nsIObliviousHttpServerResponse, response: *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 nsIObliviousHttpServerResponse {
/// `readonly attribute Array<octet> request;`
#[inline]
pub unsafe fn GetRequest(&self, aRequest: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetRequest)(self, aRequest)
}
/// `Array<octet> encapsulate (in Array<octet> response);`
#[inline]
pub unsafe fn Encapsulate(&self, response: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).Encapsulate)(self, response, _retval)
}
}
/// `interface nsIObliviousHttpServer : 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 nsIObliviousHttpServer {
vtable: &'static nsIObliviousHttpServerVTable,
/// 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 nsIObliviousHttpServer.
unsafe impl XpCom for nsIObliviousHttpServer {
const IID: nsIID = nsID(0xfb1abc56, 0xb525, 0x4e1a,
[0xa4, 0xc6, 0x34, 0x1a, 0x9b, 0x32, 0x08, 0x4e]);
}
// 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 nsIObliviousHttpServer {
#[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 nsIObliviousHttpServer.
// 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 nsIObliviousHttpServerCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttpServer`.
fn coerce_from(v: &nsIObliviousHttpServer) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpServerCoerce for nsIObliviousHttpServer {
#[inline]
fn coerce_from(v: &nsIObliviousHttpServer) -> &Self {
v
}
}
impl nsIObliviousHttpServer {
/// Cast this `nsIObliviousHttpServer` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpServerCoerce>(&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 nsIObliviousHttpServer {
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> nsIObliviousHttpServerCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttpServer) -> &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 nsIObliviousHttpServer
// 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 nsIObliviousHttpServerVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute Array<octet> encodedConfig; */
pub GetEncodedConfig: unsafe extern "system" fn (this: *const nsIObliviousHttpServer, aEncodedConfig: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* nsIObliviousHttpServerResponse decapsulate (in Array<octet> encRequest); */
pub Decapsulate: unsafe extern "system" fn (this: *const nsIObliviousHttpServer, encRequest: *const thin_vec::ThinVec<u8>, _retval: *mut *const nsIObliviousHttpServerResponse) -> ::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 nsIObliviousHttpServer {
/// `readonly attribute Array<octet> encodedConfig;`
#[inline]
pub unsafe fn GetEncodedConfig(&self, aEncodedConfig: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetEncodedConfig)(self, aEncodedConfig)
}
/// `nsIObliviousHttpServerResponse decapsulate (in Array<octet> encRequest);`
#[inline]
pub unsafe fn Decapsulate(&self, encRequest: *const thin_vec::ThinVec<u8>, _retval: *mut *const nsIObliviousHttpServerResponse) -> ::nserror::nsresult {
((*self.vtable).Decapsulate)(self, encRequest, _retval)
}
}
/// `interface nsIObliviousHttp : 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 nsIObliviousHttp {
vtable: &'static nsIObliviousHttpVTable,
/// 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 nsIObliviousHttp.
unsafe impl XpCom for nsIObliviousHttp {
const IID: nsIID = nsID(0xd581149e, 0x3319, 0x4563,
[0xb9, 0x5e, 0x46, 0xc6, 0x4a, 0xf5, 0xc4, 0xe8]);
}
// 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 nsIObliviousHttp {
#[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 nsIObliviousHttp.
// 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 nsIObliviousHttpCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttp`.
fn coerce_from(v: &nsIObliviousHttp) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpCoerce for nsIObliviousHttp {
#[inline]
fn coerce_from(v: &nsIObliviousHttp) -> &Self {
v
}
}
impl nsIObliviousHttp {
/// Cast this `nsIObliviousHttp` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpCoerce>(&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 nsIObliviousHttp {
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> nsIObliviousHttpCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttp) -> &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 nsIObliviousHttp
// 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 nsIObliviousHttpVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* nsIObliviousHttpClientRequest encapsulateRequest (in Array<octet> encodedConfig, in Array<octet> request); */
pub EncapsulateRequest: unsafe extern "system" fn (this: *const nsIObliviousHttp, encodedConfig: *const thin_vec::ThinVec<u8>, request: *const thin_vec::ThinVec<u8>, _retval: *mut *const nsIObliviousHttpClientRequest) -> ::nserror::nsresult,
/* nsIObliviousHttpServer server (); */
pub Server: unsafe extern "system" fn (this: *const nsIObliviousHttp, _retval: *mut *const nsIObliviousHttpServer) -> ::nserror::nsresult,
/* Array<Array<octet>> decodeConfigList (in Array<octet> encodedConfigList); */
pub DecodeConfigList: unsafe extern "system" fn (this: *const nsIObliviousHttp, encodedConfigList: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<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 nsIObliviousHttp {
/// `nsIObliviousHttpClientRequest encapsulateRequest (in Array<octet> encodedConfig, in Array<octet> request);`
#[inline]
pub unsafe fn EncapsulateRequest(&self, encodedConfig: *const thin_vec::ThinVec<u8>, request: *const thin_vec::ThinVec<u8>, _retval: *mut *const nsIObliviousHttpClientRequest) -> ::nserror::nsresult {
((*self.vtable).EncapsulateRequest)(self, encodedConfig, request, _retval)
}
/// `nsIObliviousHttpServer server ();`
#[inline]
pub unsafe fn Server(&self, _retval: *mut *const nsIObliviousHttpServer) -> ::nserror::nsresult {
((*self.vtable).Server)(self, _retval)
}
/// `Array<Array<octet>> decodeConfigList (in Array<octet> encodedConfigList);`
#[inline]
pub unsafe fn DecodeConfigList(&self, encodedConfigList: *const thin_vec::ThinVec<u8>, _retval: *mut thin_vec::ThinVec<thin_vec::ThinVec<u8>>) -> ::nserror::nsresult {
((*self.vtable).DecodeConfigList)(self, encodedConfigList, _retval)
}
}
/// `interface nsIObliviousHttpService : 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 nsIObliviousHttpService {
vtable: &'static nsIObliviousHttpServiceVTable,
/// 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 nsIObliviousHttpService.
unsafe impl XpCom for nsIObliviousHttpService {
const IID: nsIID = nsID(0xb1f08d56, 0xfca6, 0x4290,
[0x95, 0x00, 0xd5, 0x16, 0x8d, 0xc9, 0xd8, 0xc3]);
}
// 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 nsIObliviousHttpService {
#[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 nsIObliviousHttpService.
// 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 nsIObliviousHttpServiceCoerce {
/// Cheaply cast a value of this type from a `nsIObliviousHttpService`.
fn coerce_from(v: &nsIObliviousHttpService) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIObliviousHttpServiceCoerce for nsIObliviousHttpService {
#[inline]
fn coerce_from(v: &nsIObliviousHttpService) -> &Self {
v
}
}
impl nsIObliviousHttpService {
/// Cast this `nsIObliviousHttpService` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIObliviousHttpServiceCoerce>(&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 nsIObliviousHttpService {
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> nsIObliviousHttpServiceCoerce for T {
#[inline]
fn coerce_from(v: &nsIObliviousHttpService) -> &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 nsIObliviousHttpService
// 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 nsIObliviousHttpServiceVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* nsIChannel newChannel (in nsIURI relayURI, in nsIURI targetURI, in Array<octet> encodedConfig); */
pub NewChannel: unsafe extern "system" fn (this: *const nsIObliviousHttpService, relayURI: *const nsIURI, targetURI: *const nsIURI, encodedConfig: *const thin_vec::ThinVec<u8>, _retval: *mut*const nsIChannel) -> ::nserror::nsresult,
/* void getTRRSettings (out nsIURI relayURI, out Array<octet> encodedConfig); */
pub GetTRRSettings: unsafe extern "system" fn (this: *const nsIObliviousHttpService, relayURI: *mut*const nsIURI, encodedConfig: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult,
/* void clearTRRConfig (); */
pub ClearTRRConfig: unsafe extern "system" fn (this: *const nsIObliviousHttpService) -> ::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 nsIObliviousHttpService {
/// `nsIChannel newChannel (in nsIURI relayURI, in nsIURI targetURI, in Array<octet> encodedConfig);`
#[inline]
pub unsafe fn NewChannel(&self, relayURI: *const nsIURI, targetURI: *const nsIURI, encodedConfig: *const thin_vec::ThinVec<u8>, _retval: *mut*const nsIChannel) -> ::nserror::nsresult {
((*self.vtable).NewChannel)(self, relayURI, targetURI, encodedConfig, _retval)
}
/// `void getTRRSettings (out nsIURI relayURI, out Array<octet> encodedConfig);`
#[inline]
pub unsafe fn GetTRRSettings(&self, relayURI: *mut*const nsIURI, encodedConfig: *mut thin_vec::ThinVec<u8>) -> ::nserror::nsresult {
((*self.vtable).GetTRRSettings)(self, relayURI, encodedConfig)
}
/// `void clearTRRConfig ();`
#[inline]
pub unsafe fn ClearTRRConfig(&self, ) -> ::nserror::nsresult {
((*self.vtable).ClearTRRConfig)(self, )
}
}