Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/security/manager/ssl/nsITransportSecurityInfo.idl
//
/// `interface nsITransportSecurityInfo : 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 nsITransportSecurityInfo {
vtable: &'static nsITransportSecurityInfoVTable,
/// 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 nsITransportSecurityInfo.
unsafe impl XpCom for nsITransportSecurityInfo {
const IID: nsIID = nsID(0x216112d3, 0x28bc, 0x4671,
[0xb0, 0x57, 0xf9, 0x8c, 0xc0, 0x9b, 0xa1, 0xea]);
}
// 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 nsITransportSecurityInfo {
#[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 nsITransportSecurityInfo.
// 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 nsITransportSecurityInfoCoerce {
/// Cheaply cast a value of this type from a `nsITransportSecurityInfo`.
fn coerce_from(v: &nsITransportSecurityInfo) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsITransportSecurityInfoCoerce for nsITransportSecurityInfo {
#[inline]
fn coerce_from(v: &nsITransportSecurityInfo) -> &Self {
v
}
}
impl nsITransportSecurityInfo {
/// Cast this `nsITransportSecurityInfo` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsITransportSecurityInfoCoerce>(&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 nsITransportSecurityInfo {
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> nsITransportSecurityInfoCoerce for T {
#[inline]
fn coerce_from(v: &nsITransportSecurityInfo) -> &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 nsITransportSecurityInfo
// 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 nsITransportSecurityInfoVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute unsigned long securityState; */
pub GetSecurityState: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aSecurityState: *mut u32) -> ::nserror::nsresult,
/* readonly attribute long errorCode; */
pub GetErrorCode: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aErrorCode: *mut i32) -> ::nserror::nsresult,
/* readonly attribute AString errorCodeString; */
pub GetErrorCodeString: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aErrorCodeString: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* readonly attribute Array<nsIX509Cert> failedCertChain; */
pub GetFailedCertChain: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aFailedCertChain: *mut thin_vec::ThinVec<Option<RefPtr<nsIX509Cert>>>) -> ::nserror::nsresult,
/* readonly attribute nsIX509Cert serverCert; */
pub GetServerCert: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aServerCert: *mut*const nsIX509Cert) -> ::nserror::nsresult,
/* readonly attribute Array<nsIX509Cert> succeededCertChain; */
pub GetSucceededCertChain: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aSucceededCertChain: *mut thin_vec::ThinVec<Option<RefPtr<nsIX509Cert>>>) -> ::nserror::nsresult,
/* [must_use] readonly attribute ACString cipherName; */
pub GetCipherName: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aCipherName: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* [must_use] readonly attribute unsigned long keyLength; */
pub GetKeyLength: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aKeyLength: *mut u32) -> ::nserror::nsresult,
/* [must_use] readonly attribute unsigned long secretKeyLength; */
pub GetSecretKeyLength: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aSecretKeyLength: *mut u32) -> ::nserror::nsresult,
/* [must_use] readonly attribute ACString keaGroupName; */
pub GetKeaGroupName: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aKeaGroupName: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* [must_use] readonly attribute ACString signatureSchemeName; */
pub GetSignatureSchemeName: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aSignatureSchemeName: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* [must_use] readonly attribute unsigned short protocolVersion; */
pub GetProtocolVersion: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aProtocolVersion: *mut u16) -> ::nserror::nsresult,
/* [must_use] readonly attribute unsigned short certificateTransparencyStatus; */
pub GetCertificateTransparencyStatus: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aCertificateTransparencyStatus: *mut u16) -> ::nserror::nsresult,
/* [must_use] readonly attribute boolean isAcceptedEch; */
pub GetIsAcceptedEch: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aIsAcceptedEch: *mut bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute boolean isDelegatedCredential; */
pub GetIsDelegatedCredential: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aIsDelegatedCredential: *mut bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute nsITransportSecurityInfo_OverridableErrorCategory overridableErrorCategory; */
pub GetOverridableErrorCategory: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aOverridableErrorCategory: *mut u32) -> ::nserror::nsresult,
/* [must_use] readonly attribute boolean madeOCSPRequests; */
pub GetMadeOCSPRequests: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aMadeOCSPRequests: *mut bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute boolean usedPrivateDNS; */
pub GetUsedPrivateDNS: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aUsedPrivateDNS: *mut bool) -> ::nserror::nsresult,
/* [must_use] readonly attribute boolean isExtendedValidation; */
pub GetIsExtendedValidation: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aIsExtendedValidation: *mut bool) -> ::nserror::nsresult,
/* [noscript,notxpcom] void SerializeToIPC (in IpcMessageWriterPtr aWriter); */
/// Unable to generate binding because `native type IPC::MessageWriter unsupported`
pub SerializeToIPC: *const ::libc::c_void,
/* [must_use] ACString toString (); */
pub ToString: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute ACString negotiatedNPN; */
pub GetNegotiatedNPN: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aNegotiatedNPN: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* readonly attribute boolean resumed; */
pub GetResumed: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aResumed: *mut bool) -> ::nserror::nsresult,
/* readonly attribute boolean isBuiltCertChainRootBuiltInRoot; */
pub GetIsBuiltCertChainRootBuiltInRoot: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aIsBuiltCertChainRootBuiltInRoot: *mut bool) -> ::nserror::nsresult,
/* readonly attribute ACString peerId; */
pub GetPeerId: unsafe extern "system" fn (this: *const nsITransportSecurityInfo, aPeerId: *mut ::nsstring::nsACString) -> ::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 nsITransportSecurityInfo {
pub const ERROR_UNSET: u32 = 0;
pub const ERROR_TRUST: u32 = 1;
pub const ERROR_DOMAIN: u32 = 2;
pub const ERROR_TIME: u32 = 3;
pub const SSL_VERSION_3: i16 = 0;
pub const TLS_VERSION_1: i16 = 1;
pub const TLS_VERSION_1_1: i16 = 2;
pub const TLS_VERSION_1_2: i16 = 3;
pub const TLS_VERSION_1_3: i16 = 4;
pub const CERTIFICATE_TRANSPARENCY_NOT_APPLICABLE: i16 = 0;
pub const CERTIFICATE_TRANSPARENCY_POLICY_COMPLIANT: i16 = 5;
pub const CERTIFICATE_TRANSPARENCY_POLICY_NOT_ENOUGH_SCTS: i16 = 6;
pub const CERTIFICATE_TRANSPARENCY_POLICY_NOT_DIVERSE_SCTS: i16 = 7;
/// `readonly attribute unsigned long securityState;`
#[inline]
pub unsafe fn GetSecurityState(&self, aSecurityState: *mut u32) -> ::nserror::nsresult {
((*self.vtable).GetSecurityState)(self, aSecurityState)
}
/// `readonly attribute long errorCode;`
#[inline]
pub unsafe fn GetErrorCode(&self, aErrorCode: *mut i32) -> ::nserror::nsresult {
((*self.vtable).GetErrorCode)(self, aErrorCode)
}
/// `readonly attribute AString errorCodeString;`
#[inline]
pub unsafe fn GetErrorCodeString(&self, aErrorCodeString: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetErrorCodeString)(self, aErrorCodeString)
}
/// ```text
/// /**
/// * The following parameters are only valid after the TLS handshake
/// * has completed. Check securityState first.
/// */
/// /**
/// * If certificate verification failed, this will be the peer certificate
/// * chain provided in the handshake, so it can be used for error reporting.
/// * If verification succeeded, this will be empty.
/// */
/// ```
///
/// `readonly attribute Array<nsIX509Cert> failedCertChain;`
#[inline]
pub unsafe fn GetFailedCertChain(&self, aFailedCertChain: *mut thin_vec::ThinVec<Option<RefPtr<nsIX509Cert>>>) -> ::nserror::nsresult {
((*self.vtable).GetFailedCertChain)(self, aFailedCertChain)
}
/// `readonly attribute nsIX509Cert serverCert;`
#[inline]
pub unsafe fn GetServerCert(&self, aServerCert: *mut*const nsIX509Cert) -> ::nserror::nsresult {
((*self.vtable).GetServerCert)(self, aServerCert)
}
/// `readonly attribute Array<nsIX509Cert> succeededCertChain;`
#[inline]
pub unsafe fn GetSucceededCertChain(&self, aSucceededCertChain: *mut thin_vec::ThinVec<Option<RefPtr<nsIX509Cert>>>) -> ::nserror::nsresult {
((*self.vtable).GetSucceededCertChain)(self, aSucceededCertChain)
}
/// `[must_use] readonly attribute ACString cipherName;`
#[inline]
pub unsafe fn GetCipherName(&self, aCipherName: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetCipherName)(self, aCipherName)
}
/// `[must_use] readonly attribute unsigned long keyLength;`
#[inline]
pub unsafe fn GetKeyLength(&self, aKeyLength: *mut u32) -> ::nserror::nsresult {
((*self.vtable).GetKeyLength)(self, aKeyLength)
}
/// `[must_use] readonly attribute unsigned long secretKeyLength;`
#[inline]
pub unsafe fn GetSecretKeyLength(&self, aSecretKeyLength: *mut u32) -> ::nserror::nsresult {
((*self.vtable).GetSecretKeyLength)(self, aSecretKeyLength)
}
/// `[must_use] readonly attribute ACString keaGroupName;`
#[inline]
pub unsafe fn GetKeaGroupName(&self, aKeaGroupName: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetKeaGroupName)(self, aKeaGroupName)
}
/// `[must_use] readonly attribute ACString signatureSchemeName;`
#[inline]
pub unsafe fn GetSignatureSchemeName(&self, aSignatureSchemeName: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetSignatureSchemeName)(self, aSignatureSchemeName)
}
/// `[must_use] readonly attribute unsigned short protocolVersion;`
#[inline]
pub unsafe fn GetProtocolVersion(&self, aProtocolVersion: *mut u16) -> ::nserror::nsresult {
((*self.vtable).GetProtocolVersion)(self, aProtocolVersion)
}
/// `[must_use] readonly attribute unsigned short certificateTransparencyStatus;`
#[inline]
pub unsafe fn GetCertificateTransparencyStatus(&self, aCertificateTransparencyStatus: *mut u16) -> ::nserror::nsresult {
((*self.vtable).GetCertificateTransparencyStatus)(self, aCertificateTransparencyStatus)
}
/// `[must_use] readonly attribute boolean isAcceptedEch;`
#[inline]
pub unsafe fn GetIsAcceptedEch(&self, aIsAcceptedEch: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetIsAcceptedEch)(self, aIsAcceptedEch)
}
/// `[must_use] readonly attribute boolean isDelegatedCredential;`
#[inline]
pub unsafe fn GetIsDelegatedCredential(&self, aIsDelegatedCredential: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetIsDelegatedCredential)(self, aIsDelegatedCredential)
}
/// `[must_use] readonly attribute nsITransportSecurityInfo_OverridableErrorCategory overridableErrorCategory;`
#[inline]
pub unsafe fn GetOverridableErrorCategory(&self, aOverridableErrorCategory: *mut u32) -> ::nserror::nsresult {
((*self.vtable).GetOverridableErrorCategory)(self, aOverridableErrorCategory)
}
/// ```text
/// /**
/// * True if OCSP requests were made to query the status of certificates
/// * used in this connection.
/// */
/// ```
///
/// `[must_use] readonly attribute boolean madeOCSPRequests;`
#[inline]
pub unsafe fn GetMadeOCSPRequests(&self, aMadeOCSPRequests: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetMadeOCSPRequests)(self, aMadeOCSPRequests)
}
/// ```text
/// /**
/// * True if the DNS record used for this connection was fetched over an encrypted connection.
/// */
/// ```
///
/// `[must_use] readonly attribute boolean usedPrivateDNS;`
#[inline]
pub unsafe fn GetUsedPrivateDNS(&self, aUsedPrivateDNS: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetUsedPrivateDNS)(self, aUsedPrivateDNS)
}
/// ```text
/// /**
/// * True only if (and after) serverCert was successfully validated as
/// * Extended Validation (EV).
/// */
/// ```
///
/// `[must_use] readonly attribute boolean isExtendedValidation;`
#[inline]
pub unsafe fn GetIsExtendedValidation(&self, aIsExtendedValidation: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetIsExtendedValidation)(self, aIsExtendedValidation)
}
/// `[noscript,notxpcom] void SerializeToIPC (in IpcMessageWriterPtr aWriter);`
const _SerializeToIPC: () = ();
/// ```text
/// /**
/// * Serializes the data represented in this interface to a base64-encoded
/// * string that can be deserialized using TransportSecurityInfo::Read.
/// */
/// ```
///
/// `[must_use] ACString toString ();`
#[inline]
pub unsafe fn ToString(&self, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).ToString)(self, _retval)
}
/// `readonly attribute ACString negotiatedNPN;`
#[inline]
pub unsafe fn GetNegotiatedNPN(&self, aNegotiatedNPN: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetNegotiatedNPN)(self, aNegotiatedNPN)
}
/// ```text
/// /**
/// * True iff the connection was resumed using the resumption token.
/// */
/// ```
///
/// `readonly attribute boolean resumed;`
#[inline]
pub unsafe fn GetResumed(&self, aResumed: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetResumed)(self, aResumed)
}
/// ```text
/// /**
/// * True iff the succeededCertChain is built in root.
/// */
/// ```
///
/// `readonly attribute boolean isBuiltCertChainRootBuiltInRoot;`
#[inline]
pub unsafe fn GetIsBuiltCertChainRootBuiltInRoot(&self, aIsBuiltCertChainRootBuiltInRoot: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetIsBuiltCertChainRootBuiltInRoot)(self, aIsBuiltCertChainRootBuiltInRoot)
}
/// ```text
/// /**
/// * The id used to uniquely identify the connection to the peer.
/// */
/// ```
///
/// `readonly attribute ACString peerId;`
#[inline]
pub unsafe fn GetPeerId(&self, aPeerId: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetPeerId)(self, aPeerId)
}
}