Struct ODNodeRef

Source
#[repr(C)]
pub struct ODNodeRef { /* private fields */ }
Available on crate feature CFOpenDirectory only.
Expand description

Opaque reference for the ODNode object

See also Apple’s documentation

Implementations§

Source§

impl ODNodeRef

Source

pub unsafe fn with_node_type( allocator: Option<&CFAllocator>, session: Option<&ODSessionRef>, node_type: ODNodeType, error: *mut *mut CFError, ) -> Option<CFRetained<ODNodeRef>>

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Creates an ODNodeRef based on a specific node type

Creates an ODNodeRef based on a specific node type

Parameter allocator: a memory allocator to use for this object

Parameter session: an ODSessionRef, either kODSessionDefault or a valid ODSessionRef can be passed

Parameter nodeType: an ODNodeType of the node to open

Parameter error: an optional CFErrorRef reference for error details

Returns: a valid ODNodeRef if successful, otherwise returns NULL. outError can be checked for details upon failure.

Source

pub unsafe fn with_name( allocator: Option<&CFAllocator>, session: Option<&ODSessionRef>, node_name: Option<&CFString>, error: *mut *mut CFError, ) -> Option<CFRetained<ODNodeRef>>

Available on crate features CFODNode and objc2-core-foundation only.

Creates an ODNodeRef based on a partciular node name

Creates an ODNodeRef based on a particular node name

Parameter allocator: a memory allocator to use for this object

Parameter session: an ODSessionRef, either kODSessionDefault or a valid ODSessionRef can be passed

Parameter nodeName: a CFStringRef of the name of the node to open

Parameter error: an optional CFErrorRef reference for error details

Returns: a valid ODNodeRef if successful, otherwise returns NULL. outError can be checked for specific error

Source

pub unsafe fn new_copy( allocator: Option<&CFAllocator>, node: Option<&ODNodeRef>, error: *mut *mut CFError, ) -> Option<CFRetained<ODNodeRef>>

Available on crate features CFODNode and objc2-core-foundation only.

Creates a copy, including any remote credentials used for Proxy and/or Node authentication

Creates a copy of the object including all credentials used for the original. Can be used for future references to the same node setup.

Parameter allocator: a memory allocator to use for this object

Parameter node: an ODNodeRef to make a copy of

Parameter error: an optional CFErrorRef reference for error details

Returns: a valid ODNodeRef if successful, otherwise returns NULL, with outError set to a CFErrorRef

Source

pub unsafe fn subnode_names( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFArray>>

Available on crate features CFODNode and objc2-core-foundation only.

Returns a CFArray of subnode names for this node, which may contain sub-nodes or search policy nodes

Returns a CFArray of subnode names for this node, which may contain sub-nodes or search policy nodes. Commonly used with Search policy nodes.

Parameter node: an ODNodeRef to use

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFArrayRef with the list of nodes, otherwise NULL, with outError set to a CFErrorRef

Source

pub unsafe fn unreachable_subnode_names( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFArray>>

Available on crate features CFODNode and objc2-core-foundation only.

Will return names of subnodes that are not currently reachable.

Will return names of subnodes that are not currently reachable. Commonly used with Search policy nodes to determine if any nodes are currently unreachable, but may also return other subnodes if the Open Directory plugin supports.

Parameter node: an ODNodeRef to use

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFArrayRef with the list of unreachable nodes or NULL if no bad nodes

Source

pub unsafe fn name(self: &ODNodeRef) -> Option<CFRetained<CFString>>

Available on crate features CFODNode and objc2-core-foundation only.

Returns the node name of the node that was opened

Returns the node name of the node that was opened

Parameter node: an ODNodeRef to use

Returns: a CFStringRef of the node name that is current or NULL if no open node

Source

pub unsafe fn details( self: &ODNodeRef, keys: Option<&CFArray>, error: *mut *mut CFError, ) -> Option<CFRetained<CFDictionary>>

Available on crate features CFODNode and objc2-core-foundation only.

Returns a dictionary with details about the node in dictionary form

Returns a dictionary with details about the node in dictionary form.

Parameter node: an ODNodeRef to use

Parameter keys: a CFArrayRef listing the keys the user wants returned, such as kODAttributeTypeStreet

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFDictionaryRef containing the requested key and values in form of a CFArray

Source

pub unsafe fn supported_record_types( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFArray>>

Available on crate features CFODNode and objc2-core-foundation only.

Returns a CFArrayRef of the record types supported by this node.

Returns a CFArrayRef of the record types supported by this node. If node does not support the check then all possible types will be returned.

Parameter node: an ODNodeRef to use

Parameter error: an optional CFErrorRef reference for error details

Returns: a valid CFArrayRef of CFStrings listing the supported Record types on this node.

Source

pub unsafe fn supported_attributes( self: &ODNodeRef, record_type: Option<&ODRecordType>, error: *mut *mut CFError, ) -> Option<CFRetained<CFArray>>

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Will return a list of attribute types supported for that attribute if possible

Will return a list of attribute types supported for that attribute if possible. If no specific types are available, then all possible values will be returned instead.

Parameter node: an ODNodeRef to use

Parameter recordType: a ODRecordTypeRef with the type of record to check attribute types. If NULL is passed it will return all possible attributes that are available.

Parameter error: an optional CFErrorRef reference for error details

Returns: a valid CFArrayRef of CFStrings listing the attributes supported for the requested record type

Source

pub unsafe fn set_credentials( self: &ODNodeRef, record_type: Option<&ODRecordType>, record_name: Option<&CFString>, password: Option<&CFString>, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Sets the credentials for interaction with the ODNode

Sets the credentials for interaction with the ODNode. Record references, etc. will use these credentials to query or change data. Setting the credentials on a node referenced by other OD object types will change the credentials for all for all references.

Parameter node: an ODNodeRef to use

Parameter recordType: a ODRecordTypeRef of the Record Type to use, if NULL is passed, defaults to a kODRecordTypeUsers

Parameter recordName: a CFString of the username to be used for this node authentication

Parameter password: a CFString of the password to be used for this node authentication

Parameter error: an optional CFErrorRef reference for error details

Returns: returns true on success, otherwise outError can be checked for details. If the authentication failed, the previous credentials are used.

Source

pub unsafe fn set_credentials_extended( self: &ODNodeRef, record_type: Option<&ODRecordType>, auth_type: Option<&ODAuthenticationType>, auth_items: Option<&CFArray>, out_auth_items: *mut *const CFArray, out_context: *mut *const ODContextRef, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Allows use of other Open Directory types of authentications to set the credentials for an ODNode

Allows the caller to use other types of authentications that are available in Open Directory, that may require response-request loops, etc. Not all OD plugins will support this call, look for kODErrorCredentialsMethodNotSupported in outError.

Parameter node: an ODNodeRef to use

Parameter recordType: a ODRecordType of the type of record to do the authentication with

Parameter authType: a ODAuthenticationType of the type of authentication to be used (e.g., kDSStdAuthNTLMv2)

Parameter authItems: a CFArray of CFData or CFString items that will be sent in order to the auth process

Parameter outAuthItems: will be assigned to a pointer of a CFArray of CFData items if there are returned values

Parameter outContext: will return a pointer to a context if caller supplies a container, and the call requires a context. If a non-NULL value is returned, then more calls must be made with the Context to continue the authorization.

Parameter error: an optional CFErrorRef reference for error details

Returns: a bool will be returned with the result of the operation and outAuthItems set with response items and outContext set for any needed continuation.

Source

pub unsafe fn set_credentials_using_kerberos_cache( self: &ODNodeRef, cache_name: Option<&CFString>, error: *mut *mut CFError, ) -> bool

👎Deprecated
Available on crate features CFODNode and objc2-core-foundation only.

Unsupported function.

Unsupported function.

Source

pub unsafe fn create_record( self: &ODNodeRef, record_type: Option<&ODRecordType>, record_name: Option<&CFString>, attribute_dict: Option<&CFDictionary>, error: *mut *mut CFError, ) -> Option<CFRetained<ODRecordRef>>

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Takes a record and all of the provided attributes and creates the record in the node

Takes all the provided attributes and type to create an entire record. The function will assign a UUID to the record automatically. This UUID can be overwritten by the client by passing with the other attributes.

Parameter node: an ODNodeRef to use

Parameter recordType: a ODRecordTypeRef of the type of record (e.g., kODRecordTypeUsers, etc.)

Parameter recordName: a CFStringRef of the name of record

Parameter attributeDict: a CFDictionaryRef of key-value pairs for attribute values. The key is a CFStringRef of the attribute name or ODRecordType constant such as kODAttributeTypeRecordName. The value must be a CFArrayRef of CFDataRef or CFStringRef. If additional kODAttributeTypeRecordName are to be set, they can be passed in the inAttributes list. This parameter is optional and can be NULL. If any of the attributes passed fail to be set, the record will be deleted and outError will be set with the appropriate error.

Parameter error: an optional CFErrorRef reference for error details

Returns: returns a valid ODRecordRef. If the add fails, outError can be checked for details.

Source

pub unsafe fn copy_record( self: &ODNodeRef, record_type: Option<&ODRecordType>, record_name: Option<&CFString>, attributes: Option<&CFType>, error: *mut *mut CFError, ) -> Option<CFRetained<ODRecordRef>>

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

Simple API to open / create a references to a particular record on a Node

Simple API to open / create a references to a particular record on a Node

Parameter node: an ODNodeRef to use

Parameter recordType: a ODRecordTypeRef of the record type to copy

Parameter recordName: a CFStringRef of the record name to copy

Parameter attributes: (optional) a CFArrayRef (or single ODAttributeType) of the attributes to copy from the directory. Can be NULL when no attributes are needed. Any standard types can be passed, for example kODAttributeTypeAllAttributes will fetch all attributes up front. If just standard attributes are needed, then kODAttributeTypeStandardOnly can be passed.

Parameter error: an optional CFErrorRef reference for error details

Returns: returns a valid ODRecordRef. If the record copy fails, the error can be checked for details. If the record is not found, will return NULL with a NULL error.

Source

pub unsafe fn custom_call( self: &ODNodeRef, custom_code: CFIndex, data: Option<&CFData>, error: *mut *mut CFError, ) -> Option<CFRetained<CFData>>

Available on crate features CFODNode and objc2-core-foundation only.

Sends a custom call to a node.

This will send a custom call to a node along with the specified data, returning the result.

Parameter node: an ODNodeRef to use

Parameter customCode: the custom code to be sent to the node

Parameter data: a data blob expected by the custom code, can be NULL of no send data

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFDataRef with the result of the operation, otherwise outError can be checked for specific details

Source

pub unsafe fn custom_function( self: &ODNodeRef, function: Option<&CFString>, payload: Option<&CFType>, error: *mut *mut CFError, ) -> Option<CFRetained<CFType>>

Available on crate features CFODNode and objc2-core-foundation only.

Sends a named custom function call to a node.

Sends a named custom function call to a node. Custom functions are defined by the modules that implement them and the parameter is defined by the module.

Parameter node: An ODNodeRef to use

Parameter function: A CFStringRef that specifies the name of the function

Parameter payload: A CFType appropriate for the custom function. The type is dictated by the module implementing the function.

Parameter error: An optional CFErrorRef reference to receive any errors from the custom function call.

Returns: Returns a CFType appropriate for the function.

Source

pub unsafe fn policies( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFDictionary>>

👎Deprecated: use ODNodeCopyAccountPolicies
Available on crate features CFODNode and objc2-core-foundation only.

This will copy any policies configured for the node.

This will copy any policies configured for the node.

Parameter node: an ODNodeRef to use

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFDictionaryRef containing all currently set policies

Source

pub unsafe fn supported_policies( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFDictionary>>

👎Deprecated
Available on crate features CFODNode and objc2-core-foundation only.

This will return a dictionary of supported policies.

This will return a dictionary of supported policies, if appropriate, the value will be the maximum value allowed for the policy in question. For example, if password history is available, it will state how much history is supported.

Parameter node: an ODNodeRef to use

Parameter error: an optional CFErrorRef reference for error details

Returns: a CFDictionaryRef containing all currently supported policies. The values will be the maximum value allowed.

Source

pub unsafe fn set_policies( self: &ODNodeRef, policies: Option<&CFDictionary>, error: *mut *mut CFError, ) -> bool

👎Deprecated: use ODNodeSetAccountPolicies
Available on crate features CFODNode and objc2-core-foundation only.

This will set the policy for the node.

This will set the policy for the node. Policies are evaluated in combination with record-level policies.

Parameter node: an ODNodeRef to use

Parameter policies: a CFDictionary of policies to be set

Parameter error: an optional CFErrorRef reference for error details

Returns: a bool which signifies if the policy set succeeded, otherwise error is set.

Source

pub unsafe fn set_policy( self: &ODNodeRef, policy_type: Option<&ODPolicyType>, value: Option<&CFType>, error: *mut *mut CFError, ) -> bool

👎Deprecated: use ODNodeAddAccountPolicy
Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

This will set a specific policy setting for the node.

This will set a specific policy setting for the node.

Parameter node: an ODNodeRef to use

Parameter policy: a valid ODPolicyType

Parameter value: a CFTypeRef to be set (should be of appropriate type for the policy)

Parameter error: an optional CFErrorRef reference for error details

Returns: a bool which signifies if the policy set succeeded, otherwise error is set.

Source

pub unsafe fn remove_policy( self: &ODNodeRef, policy_type: Option<&ODPolicyType>, error: *mut *mut CFError, ) -> bool

👎Deprecated: use ODNodeRemoveAccountPolicy
Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

This will remove a specific policy setting from the node.

This will remove a specific policy setting from the node.

Parameter node: an ODNodeRef to use

Parameter policy: a valid ODPolicyType

Parameter error: an optional CFErrorRef reference for error details

Returns: a bool which signifies if the policy removal succeeded, otherwise error is set.

Source

pub unsafe fn add_account_policy( self: &ODNodeRef, policy: Option<&CFDictionary>, category: Option<&ODPolicyCategoryType>, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

This will add an account policy to the node for the specified category.

This will add an account policy to the node for the specified category. The specified policy will be applied to all users in the specified node when policies are evaluated.

Parameter node: an ODNodeRef to use.

Parameter policy: a dictionary containing the specific policy to be added. The dictionary may contain the following keys: kODPolicyKeyIdentifier a required key identifying the policy. kODPolicyKeyParameters an optional key containing a dictionary of parameters that can be used for informational purposes or in the policy format string. kODPolicyKeyContent a required key specifying the policy, from which a predicate will be created for evaluating the policy.

Parameter category: a valid ODPolicyCategoryType to which the specified policy will be added.

Parameter error: an optional CFErrorRef reference for error details.

Returns: a bool which signifies if the policy addition succeeded, otherwise error is set.

Source

pub unsafe fn remove_account_policy( self: &ODNodeRef, policy: Option<&CFDictionary>, category: Option<&ODPolicyCategoryType>, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and CFOpenDirectoryConstants and objc2-core-foundation only.

This will remove an account policy from the node for the specified category.

This will remove an account policy from the node for the specified category.

Parameter node: an ODNodeRef to use.

Parameter policy: a dictionary containing the specific policy to be removed, with the same format as described in ODNodeAddAccountPolicy.

Parameter category: a valid ODPolicyCategoryType from which the specified policy will be removed.

Parameter error: an optional CFErrorRef reference for error details.

Returns: a bool which signifies if the policy removal succeeded, otherwise error is set.

Source

pub unsafe fn set_account_policies( self: &ODNodeRef, policies: Option<&CFDictionary>, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and objc2-core-foundation only.

This will set the policies for the node.

This will set the policies for the node, replacing any existing policies.

Parameter node: an ODNodeRef to use.

Parameter policies: a dictionary containing all of the policies to be set for the node. The dictionary may contain the following keys: kODPolicyCategoryAuthentication an optional key with a value of an array of policy dictionaries that specify when authentications should be allowed. kODPolicyCategoryPasswordContent an optional key with a value of an array of policy dictionaries the specify the required content of passwords. kODPolicyCategoryPasswordChange an optional key with a value of an array of policy dictionaries that specify when passwords are required to be changed.

Parameter error: an optional CFErrorRef reference for error details.

Returns: a bool which signifies if the policy set succeeded, otherwise error is set.

Source

pub unsafe fn account_policies( self: &ODNodeRef, error: *mut *mut CFError, ) -> Option<CFRetained<CFDictionary>>

Available on crate features CFODNode and objc2-core-foundation only.

This will copy any policies configured for the node.

This will copy any policies configured for the node.

Parameter node: an ODNodeRef to use.

Parameter error: an optional CFErrorRef reference for error details.

Returns: a CFDictionaryRef containing all currently set policies. The format of the dictionary is the same as described in ODNodeSetAccountPolicies().

Source

pub unsafe fn password_content_check( self: &ODNodeRef, password: Option<&CFString>, record_name: Option<&CFString>, error: *mut *mut CFError, ) -> bool

Available on crate features CFODNode and objc2-core-foundation only.

Validates a password against the node’s password content policies.

Validates a password against the node’s password content policies. The node’s password content policies will be evaluated to determine if the password is acceptable. May be used prior to creating the record.

This check is only definitive at the time it was requested. The policy or the environment could change before the password change is actually requested. Errors from the password change request should be consulted.

Parameter node: an ODNodeRef to use.

Parameter password: the password to be evaluated against the content policies.

Parameter recordName: the name of the record.

Parameter error: an optional CFErrorRef reference for error details.

Returns: a bool which signifies if the password passes all content policies, otherwise error is set.

Methods from Deref<Target = CFType>§

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: ConcreteType,

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.

Source

pub fn retain_count(&self) -> usize

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 CFNumbers, small CFStrings 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 ODNodeRef

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFType> for ODNodeRef

Source§

fn as_ref(&self) -> &CFType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ODNodeRef> for ODNodeRef

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for ODNodeRef

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CFType> for ODNodeRef

Source§

fn borrow(&self) -> &CFType

Immutably borrows from an owned value. Read more
Source§

impl ConcreteType for ODNodeRef

Available on crate features CFODNode and objc2-core-foundation only.
Source§

fn type_id() -> CFTypeID

Standard GetTypeID function support for CF-based objects

Returns the typeID for the ODNode objects

Returns: a valid CFTypeID for the ODNode object

Source§

impl Debug for ODNodeRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for ODNodeRef

Source§

type Target = CFType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for ODNodeRef

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for ODNodeRef

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl PartialEq for ODNodeRef

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for ODNodeRef

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Type for ODNodeRef

Source§

fn retain(&self) -> CFRetained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

fn as_concrete_TypeRef(&self) -> &Self

👎Deprecated: this is redundant
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::retain
Helper for easier transition from the core-foundation crate. Read more
Source§

fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<CFType>,

👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the core-foundation crate. Read more
Source§

impl Eq for ODNodeRef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,