#[repr(C)]pub struct SecRequirement { /* private fields */ }
CSCommon
only.Expand description
This is the type of a reference to a code requirement.
See also Apple’s documentation
Implementations§
Source§impl SecRequirement
impl SecRequirement
Sourcepub unsafe fn create_with_data(
data: &CFData,
flags: SecCSFlags,
requirement: NonNull<*mut SecRequirement>,
) -> i32
Available on crate feature SecRequirement
only.
pub unsafe fn create_with_data( data: &CFData, flags: SecCSFlags, requirement: NonNull<*mut SecRequirement>, ) -> i32
SecRequirement
only.Create a SecRequirement object from binary form. This is the effective inverse of SecRequirementCopyData.
Parameter data
: A binary blob obtained earlier from a valid SecRequirement object
using the SecRequirementCopyData call. This is the only publicly supported
way to get such a data blob.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter requirement
: On successful return, contains a reference to a SecRequirement
object that behaves identically to the one the data blob was obtained from.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
Sourcepub unsafe fn create_with_string(
text: &CFString,
flags: SecCSFlags,
requirement: NonNull<*mut SecRequirement>,
) -> i32
Available on crate feature SecRequirement
only.
pub unsafe fn create_with_string( text: &CFString, flags: SecCSFlags, requirement: NonNull<*mut SecRequirement>, ) -> i32
SecRequirement
only.Create a SecRequirement object by compiling a valid text representation of a requirement.
Parameter text
: A CFString containing the text form of a (single) Code Requirement.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter requirement
: On successful return, contains a reference to a SecRequirement
object that implements the conditions described in text.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
pub unsafe fn create_with_string_and_errors( text: &CFString, flags: SecCSFlags, errors: *mut *mut CFError, requirement: NonNull<*mut SecRequirement>, ) -> i32
SecRequirement
only.Sourcepub unsafe fn copy_data(
self: &SecRequirement,
flags: SecCSFlags,
data: NonNull<*const CFData>,
) -> i32
Available on crate feature SecRequirement
only.
pub unsafe fn copy_data( self: &SecRequirement, flags: SecCSFlags, data: NonNull<*const CFData>, ) -> i32
SecRequirement
only.Extracts a stable, persistent binary form of a SecRequirement. This is the effective inverse of SecRequirementCreateWithData.
Parameter requirement
: A valid SecRequirement object.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter data
: On successful return, contains a reference to a CFData object
containing a binary blob that can be fed to SecRequirementCreateWithData
to recreate a SecRequirement object with identical behavior.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
Sourcepub unsafe fn copy_string(
self: &SecRequirement,
flags: SecCSFlags,
text: NonNull<*const CFString>,
) -> i32
Available on crate feature SecRequirement
only.
pub unsafe fn copy_string( self: &SecRequirement, flags: SecCSFlags, text: NonNull<*const CFString>, ) -> i32
SecRequirement
only.Converts a SecRequirement object into text form. This is the effective inverse of SecRequirementCreateWithString.
Repeated application of this function may produce text that differs in formatting, may contain different source comments, and may perform its validation functions in different order. However, it is guaranteed that recompiling the text using SecRequirementCreateWithString will produce a SecRequirement object that behaves identically to the one you start with.
Parameter requirement
: A valid SecRequirement object.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter text
: On successful return, contains a reference to a CFString object
containing a text representation of the requirement.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Available on crate feature SecCustomTransform
only.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
SecCustomTransform
only.Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
Available on crate feature SecCustomTransform
only.
pub fn retain_count(&self) -> usize
SecCustomTransform
only.Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for SecRequirement
impl AsRef<AnyObject> for SecRequirement
Source§impl AsRef<CFType> for SecRequirement
impl AsRef<CFType> for SecRequirement
Source§impl AsRef<SecRequirement> for SecRequirement
impl AsRef<SecRequirement> for SecRequirement
Source§impl Borrow<AnyObject> for SecRequirement
impl Borrow<AnyObject> for SecRequirement
Source§impl Borrow<CFType> for SecRequirement
impl Borrow<CFType> for SecRequirement
Source§impl ConcreteType for SecRequirement
Available on crate feature SecRequirement
only.
impl ConcreteType for SecRequirement
SecRequirement
only.Source§impl Debug for SecRequirement
impl Debug for SecRequirement
Source§impl Deref for SecRequirement
impl Deref for SecRequirement
Source§impl Hash for SecRequirement
impl Hash for SecRequirement
Source§impl Message for SecRequirement
impl Message for SecRequirement
Source§impl PartialEq for SecRequirement
impl PartialEq for SecRequirement
Source§impl RefEncode for SecRequirement
impl RefEncode for SecRequirement
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for SecRequirement
impl Type for SecRequirement
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read more