Struct objc2_foundation::NSCountedSet

source ·
#[repr(C)]
pub struct NSCountedSet<ObjectType: ?Sized = AnyObject> { /* private fields */ }
Available on crate feature NSSet only.

Implementations§

source§

impl<ObjectType: Message> NSCountedSet<ObjectType>

source

pub unsafe fn initWithCapacity( this: Allocated<Self>, num_items: NSUInteger ) -> Id<Self>

source

pub unsafe fn initWithArray( this: Allocated<Self>, array: &NSArray<ObjectType> ) -> Id<Self>

Available on crate feature NSArray only.
source

pub unsafe fn initWithSet( this: Allocated<Self>, set: &NSSet<ObjectType> ) -> Id<Self>

source

pub unsafe fn countForObject(&self, object: &ObjectType) -> NSUInteger

source

pub unsafe fn objectEnumerator(&self) -> Id<NSEnumerator<ObjectType>>

Available on crate feature NSEnumerator only.
source

pub unsafe fn addObject(&self, object: &ObjectType)

source

pub unsafe fn removeObject(&self, object: &ObjectType)

source§

impl<ObjectType: Message> NSCountedSet<ObjectType>

Methods declared on superclass NSMutableSet

source

pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder ) -> Option<Id<Self>>

Available on crate feature NSCoder only.
source

pub unsafe fn init(this: Allocated<Self>) -> Id<Self>

source§

impl<ObjectType: Message> NSCountedSet<ObjectType>

Methods declared on superclass NSSet

source

pub unsafe fn initWithObjects_count( this: Allocated<Self>, objects: *mut NonNull<ObjectType>, cnt: NSUInteger ) -> Id<Self>

source§

impl<ObjectType: Message> NSCountedSet<ObjectType>

Methods declared on superclass NSObject

source

pub unsafe fn new() -> Id<Self>

Methods from Deref<Target = NSMutableSet<ObjectType>>§

source

pub unsafe fn filterUsingPredicate(&mut self, predicate: &NSPredicate)

Available on crate feature NSPredicate only.
source

pub unsafe fn addObject(&mut self, object: &ObjectType)

source

pub unsafe fn removeObject(&mut self, object: &ObjectType)

source

pub unsafe fn addObjectsFromArray(&mut self, array: &NSArray<ObjectType>)

Available on crate feature NSArray only.
source

pub unsafe fn intersectSet(&mut self, other_set: &NSSet<ObjectType>)

source

pub unsafe fn minusSet(&mut self, other_set: &NSSet<ObjectType>)

source

pub fn removeAllObjects(&mut self)

source

pub unsafe fn unionSet(&mut self, other_set: &NSSet<ObjectType>)

source

pub unsafe fn setSet(&mut self, other_set: &NSSet<ObjectType>)

source

pub fn insert(&mut self, value: &T) -> bool

Add a value to the set. Returns whether the value was newly inserted.

§Examples
use objc2_foundation::{NSNumber, NSMutableSet};

let mut set = NSMutableSet::new();

assert_eq!(set.insert(&*NSNumber::new_u32(42)), true);
assert_eq!(set.insert(&*NSNumber::new_u32(42)), false);
assert_eq!(set.len(), 1);
source

pub fn insert_id(&mut self, value: Id<T>) -> bool
where T: HasStableHash,

Add an Id to the set. Returns whether the value was newly inserted.

§Examples
use objc2_foundation::{NSMutableSet, NSString};

let mut set = NSMutableSet::new();

assert_eq!(set.insert_id(NSString::from_str("one")), true);
assert_eq!(set.insert_id(NSString::from_str("one")), false);
assert_eq!(set.len(), 1);
source

pub fn remove(&mut self, value: &T) -> bool
where T: HasStableHash,

Removes a value from the set. Returns whether the value was present in the set.

§Examples
use objc2_foundation::{ns_string, NSMutableSet, NSString};

let mut set = NSMutableSet::new();

set.insert_id(NSString::from_str("one"));
assert_eq!(set.remove(ns_string!("one")), true);
assert_eq!(set.remove(ns_string!("one")), false);

Methods from Deref<Target = NSSet<ObjectType>>§

source

pub unsafe fn valueForKey(&self, key: &NSString) -> Id<AnyObject>

Available on crate features NSKeyValueCoding and NSString only.
source

pub unsafe fn setValue_forKey(&self, value: Option<&AnyObject>, key: &NSString)

Available on crate features NSKeyValueCoding and NSString only.
source

pub unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, key_path: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void )

Available on crate features NSKeyValueObserving and NSString only.
source

pub unsafe fn removeObserver_forKeyPath_context( &self, observer: &NSObject, key_path: &NSString, context: *mut c_void )

Available on crate features NSKeyValueObserving and NSString only.
source

pub unsafe fn removeObserver_forKeyPath( &self, observer: &NSObject, key_path: &NSString )

Available on crate features NSKeyValueObserving and NSString only.
source

pub unsafe fn filteredSetUsingPredicate( &self, predicate: &NSPredicate ) -> Id<NSSet<ObjectType>>

Available on crate feature NSPredicate only.
source

pub fn count(&self) -> NSUInteger

source

pub unsafe fn member(&self, object: &ObjectType) -> Option<Id<ObjectType>>

source

pub unsafe fn objectEnumerator(&self) -> Id<NSEnumerator<ObjectType>>

Available on crate feature NSEnumerator only.
source

pub unsafe fn allObjects(&self) -> Id<NSArray<ObjectType>>

Available on crate feature NSArray only.
source

pub unsafe fn anyObject(&self) -> Option<Id<ObjectType>>

source

pub unsafe fn containsObject(&self, an_object: &ObjectType) -> bool

source

pub unsafe fn description(&self) -> Id<NSString>

Available on crate feature NSString only.
source

pub unsafe fn descriptionWithLocale( &self, locale: Option<&AnyObject> ) -> Id<NSString>

Available on crate feature NSString only.
source

pub unsafe fn intersectsSet(&self, other_set: &NSSet<ObjectType>) -> bool

source

pub unsafe fn isEqualToSet(&self, other_set: &NSSet<ObjectType>) -> bool

source

pub unsafe fn isSubsetOfSet(&self, other_set: &NSSet<ObjectType>) -> bool

source

pub unsafe fn makeObjectsPerformSelector(&self, a_selector: Sel)

source

pub unsafe fn makeObjectsPerformSelector_withObject( &self, a_selector: Sel, argument: Option<&AnyObject> )

source

pub unsafe fn setByAddingObject( &self, an_object: &ObjectType ) -> Id<NSSet<ObjectType>>

source

pub unsafe fn setByAddingObjectsFromSet( &self, other: &NSSet<ObjectType> ) -> Id<NSSet<ObjectType>>

source

pub unsafe fn setByAddingObjectsFromArray( &self, other: &NSArray<ObjectType> ) -> Id<NSSet<ObjectType>>

Available on crate feature NSArray only.
source

pub unsafe fn enumerateObjectsUsingBlock( &self, block: &Block<dyn Fn(NonNull<ObjectType>, NonNull<Bool>) + '_> )

Available on crate feature block2 only.
source

pub unsafe fn enumerateObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: &Block<dyn Fn(NonNull<ObjectType>, NonNull<Bool>) + '_> )

Available on crate features NSObjCRuntime and block2 only.
source

pub unsafe fn objectsPassingTest( &self, predicate: &Block<dyn Fn(NonNull<ObjectType>, NonNull<Bool>) -> Bool + '_> ) -> Id<NSSet<ObjectType>>

Available on crate feature block2 only.
source

pub unsafe fn objectsWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: &Block<dyn Fn(NonNull<ObjectType>, NonNull<Bool>) -> Bool + '_> ) -> Id<NSSet<ObjectType>>

Available on crate features NSObjCRuntime and block2 only.
source

pub unsafe fn sortedArrayUsingDescriptors( &self, sort_descriptors: &NSArray<NSSortDescriptor> ) -> Id<NSArray<ObjectType>>

Available on crate features NSSortDescriptor and NSArray only.
source

pub fn len(&self) -> usize

Returns the number of elements in the set.

§Examples
use objc2_foundation::{NSSet, NSString};

let strs = ["one", "two", "three"].map(NSString::from_str);
let set = NSSet::from_id_slice(&strs);
assert_eq!(set.len(), 3);
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

§Examples
use objc2_foundation::{NSSet, NSString};

let set = NSSet::<NSString>::new();
assert!(set.is_empty());
source

pub fn to_vec(&self) -> Vec<&T>

Available on crate feature NSEnumerator only.

Returns a Vec containing the set’s elements.

§Examples
use objc2_foundation::{NSMutableString, NSSet};

let strs = vec![
    NSMutableString::from_str("one"),
    NSMutableString::from_str("two"),
    NSMutableString::from_str("three"),
];
let set = NSSet::from_vec(strs);
let vec = set.to_vec();
assert_eq!(vec.len(), 3);
source

pub fn to_vec_retained(&self) -> Vec<Id<T>>
where T: IsIdCloneable,

Available on crate feature NSEnumerator only.
source

pub fn to_array(&self) -> Id<NSArray<T>>
where T: IsIdCloneable,

Available on crate feature NSArray only.

Returns an NSArray containing the set’s elements, or an empty array if the set is empty.

§Examples
use objc2_foundation::{NSNumber, NSSet, NSString};

let nums = [1, 2, 3];
let set = NSSet::from_id_slice(&nums.map(NSNumber::new_i32));

assert_eq!(set.to_array().len(), 3);
assert!(set.to_array().iter().all(|i| nums.contains(&i.as_i32())));
source

pub fn get_any(&self) -> Option<&T>

Returns a reference to one of the objects in the set, or None if the set is empty.

§Examples
use objc2_foundation::{NSSet, NSString};

let strs = ["one", "two", "three"].map(NSString::from_str);
let set = NSSet::from_id_slice(&strs);
let any = set.get_any().unwrap();
assert!(any == &*strs[0] || any == &*strs[1] || any == &*strs[2]);
source

pub fn contains(&self, value: &T) -> bool

Returns true if the set contains a value.

§Examples
use objc2_foundation::{ns_string, NSSet, NSString};

let strs = ["one", "two", "three"].map(NSString::from_str);
let set = NSSet::from_id_slice(&strs);
assert!(set.contains(ns_string!("one")));
source

pub fn get(&self, value: &T) -> Option<&T>

Returns a reference to the value in the set, if any, that is equal to the given value.

§Examples
use objc2_foundation::{ns_string, NSSet, NSString};

let strs = ["one", "two", "three"].map(NSString::from_str);
let set = NSSet::from_id_slice(&strs);
assert_eq!(set.get(ns_string!("one")), Some(&*strs[0]));
assert_eq!(set.get(ns_string!("four")), None);
source

pub fn get_retained(&self, value: &T) -> Option<Id<T>>
where T: IsIdCloneable,

source

pub fn is_subset(&self, other: &NSSet<T>) -> bool

Returns true if the set is a subset of another, i.e., other contains at least all the values in self.

§Examples
use objc2_foundation::{NSSet, NSString};

let set1 = NSSet::from_id_slice(&["one", "two"].map(NSString::from_str));
let set2 = NSSet::from_id_slice(&["one", "two", "three"].map(NSString::from_str));

assert!(set1.is_subset(&set2));
assert!(!set2.is_subset(&set1));
source

pub fn is_superset(&self, other: &NSSet<T>) -> bool

Returns true if the set is a superset of another, i.e., self contains at least all the values in other.

§Examples
use objc2_foundation::{NSSet, NSString};

let set1 = NSSet::from_id_slice(&["one", "two"].map(NSString::from_str));
let set2 = NSSet::from_id_slice(&["one", "two", "three"].map(NSString::from_str));

assert!(!set1.is_superset(&set2));
assert!(set2.is_superset(&set1));
source

pub fn is_disjoint(&self, other: &NSSet<T>) -> bool

Returns true if self has no elements in common with other.

§Examples
use objc2_foundation::{NSSet, NSString};

let set1 = NSSet::from_id_slice(&["one", "two"].map(NSString::from_str));
let set2 = NSSet::from_id_slice(&["one", "two", "three"].map(NSString::from_str));
let set3 = NSSet::from_id_slice(&["four", "five", "six"].map(NSString::from_str));

assert!(!set1.is_disjoint(&set2));
assert!(set1.is_disjoint(&set3));
assert!(set2.is_disjoint(&set3));
source

pub fn iter(&self) -> Iter<'_, T>

Available on crate feature NSEnumerator only.

An iterator visiting all elements in arbitrary order.

§Examples
use objc2_foundation::{NSSet, NSString};

let strs = ["one", "two", "three"].map(NSString::from_str);
let set = NSSet::from_id_slice(&strs);
for s in &set {
    println!("{s}");
}
source

pub fn iter_retained(&self) -> IterRetained<'_, T>
where T: IsIdCloneable,

Available on crate feature NSEnumerator only.

Methods from Deref<Target = NSObject>§

source

pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !

Handle messages the object doesn’t recognize.

See Apple’s documentation for details.

Methods from Deref<Target = AnyObject>§

source

pub fn class(&self) -> &'static AnyClass

Dynamically find the class of this object.

§Example

Check that an instance of NSObject has the precise class NSObject.

use objc2::ClassType;
use objc2::runtime::NSObject;

let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load instead.

Use Ivar::load instead.

§Safety

The object must have an instance variable with the given name, and it must be of type T.

See Ivar::load_ptr for details surrounding this.

source

pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load_mut instead.

Use Ivar::load_mut instead.

§Safety

The object must have an instance variable with the given name, and it must be of type T.

See Ivar::load_ptr for details surrounding this.

Trait Implementations§

source§

impl<ObjectType: ?Sized + Message> AsMut<AnyObject> for NSCountedSet<ObjectType>

source§

fn as_mut(&mut self) -> &mut AnyObject

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<ObjectType: ?Sized + Message> AsMut<NSCountedSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<ObjectType: ?Sized + Message> AsMut<NSMutableSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_mut(&mut self) -> &mut NSMutableSet<ObjectType>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<ObjectType: ?Sized + Message> AsMut<NSObject> for NSCountedSet<ObjectType>

source§

fn as_mut(&mut self) -> &mut NSObject

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<ObjectType: ?Sized + Message> AsMut<NSSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_mut(&mut self) -> &mut NSSet<ObjectType>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<ObjectType: ?Sized + Message> AsRef<AnyObject> for NSCountedSet<ObjectType>

source§

fn as_ref(&self) -> &AnyObject

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

impl<ObjectType: ?Sized + Message> AsRef<NSCountedSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_ref(&self) -> &Self

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

impl<ObjectType: ?Sized + Message> AsRef<NSMutableSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_ref(&self) -> &NSMutableSet<ObjectType>

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

impl<ObjectType: ?Sized + Message> AsRef<NSObject> for NSCountedSet<ObjectType>

source§

fn as_ref(&self) -> &NSObject

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

impl<ObjectType: ?Sized + Message> AsRef<NSSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn as_ref(&self) -> &NSSet<ObjectType>

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

impl<ObjectType: ?Sized + Message> Borrow<AnyObject> for NSCountedSet<ObjectType>

source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> Borrow<NSMutableSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn borrow(&self) -> &NSMutableSet<ObjectType>

Immutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> Borrow<NSObject> for NSCountedSet<ObjectType>

source§

fn borrow(&self) -> &NSObject

Immutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> Borrow<NSSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn borrow(&self) -> &NSSet<ObjectType>

Immutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> BorrowMut<AnyObject> for NSCountedSet<ObjectType>

source§

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

Mutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> BorrowMut<NSMutableSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn borrow_mut(&mut self) -> &mut NSMutableSet<ObjectType>

Mutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> BorrowMut<NSObject> for NSCountedSet<ObjectType>

source§

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

Mutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> BorrowMut<NSSet<ObjectType>> for NSCountedSet<ObjectType>

source§

fn borrow_mut(&mut self) -> &mut NSSet<ObjectType>

Mutably borrows from an owned value. Read more
source§

impl<ObjectType: ?Sized + Message> ClassType for NSCountedSet<ObjectType>

§

type Super = NSMutableSet<ObjectType>

The superclass of this class. Read more
§

type Mutability = Mutable

Whether the type is mutable or immutable. Read more
source§

const NAME: &'static str = "NSCountedSet"

The name of the Objective-C class that this type represents. Read more
source§

fn class() -> &'static AnyClass

Get a reference to the Objective-C class that this type represents. Read more
source§

fn as_super(&self) -> &Self::Super

Get an immutable reference to the superclass.
source§

fn as_super_mut(&mut self) -> &mut Self::Super

Get a mutable reference to the superclass.
source§

fn alloc() -> Allocated<Self>

Allocate a new instance of the class. Read more
source§

impl<T: Debug + Message> Debug for NSCountedSet<T>

Available on crate feature NSEnumerator only.
source§

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

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

impl<ObjectType: ?Sized + Message> Deref for NSCountedSet<ObjectType>

§

type Target = NSMutableSet<ObjectType>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<ObjectType: ?Sized + Message> DerefMut for NSCountedSet<ObjectType>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<ObjectType: Hash + ?Sized> Hash for NSCountedSet<ObjectType>

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<ObjectType: PartialEq + ?Sized> PartialEq for NSCountedSet<ObjectType>

source§

fn eq(&self, other: &NSCountedSet<ObjectType>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<ObjectType: ?Sized + Message> RefEncode for NSCountedSet<ObjectType>

source§

const ENCODING_REF: Encoding = <NSMutableSet<ObjectType> as ::objc2::RefEncode>::ENCODING_REF

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

impl<ObjectType: Eq + ?Sized> Eq for NSCountedSet<ObjectType>

source§

impl<ObjectType: ?Sized + Message> Message for NSCountedSet<ObjectType>

source§

impl<ObjectType: ?Sized + NSCoding> NSCoding for NSCountedSet<ObjectType>

Available on crate feature NSObject only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSCountedSet<ObjectType>

Available on crate feature NSObject only.
source§

impl<ObjectType: ?Sized> NSFastEnumeration for NSCountedSet<ObjectType>

Available on crate feature NSEnumerator only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSMutableCopying for NSCountedSet<ObjectType>

Available on crate feature NSObject only.
source§

impl<ObjectType: ?Sized> NSObjectProtocol for NSCountedSet<ObjectType>

source§

impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for NSCountedSet<ObjectType>

Available on crate feature NSObject only.
source§

impl<ObjectType: ?Sized> StructuralPartialEq for NSCountedSet<ObjectType>

Auto Trait Implementations§

§

impl<ObjectType = AnyObject> !Freeze for NSCountedSet<ObjectType>

§

impl<ObjectType> RefUnwindSafe for NSCountedSet<ObjectType>
where ObjectType: RefUnwindSafe + ?Sized,

§

impl<ObjectType> Send for NSCountedSet<ObjectType>
where ObjectType: ClassType + Send + ?Sized, <ObjectType as ClassType>::Mutability: IdSendSyncHelper<ObjectType>, <<ObjectType as ClassType>::Mutability as IdSendSyncHelper<ObjectType>>::EquivalentType: Send,

§

impl<ObjectType> Sync for NSCountedSet<ObjectType>
where ObjectType: ClassType + Sync + ?Sized, <ObjectType as ClassType>::Mutability: IdSendSyncHelper<ObjectType>, <<ObjectType as ClassType>::Mutability as IdSendSyncHelper<ObjectType>>::EquivalentType: Sync,

§

impl<ObjectType = AnyObject> !Unpin for NSCountedSet<ObjectType>

§

impl<ObjectType> UnwindSafe for NSCountedSet<ObjectType>
where ObjectType: RefUnwindSafe + UnwindSafe + ?Sized,

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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,