### take Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Illustrates taking the value out of an Option, leaving None in its place. ```rust let mut x = Some(2); let y = x.take(); assert_eq!(x, None); assert_eq!(y, Some(2)); let mut x: Option = None; let y = x.take(); assert_eq!(x, None); assert_eq!(y, None); ``` -------------------------------- ### xor Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Illustrates the `xor` method, which returns Some if exactly one of the options is Some. ```rust let x = Some(2); let y: Option = None; assert_eq!(x.xor(y), Some(2)); let x: Option = None; let y = Some(2); assert_eq!(x.xor(y), Some(2)); let x = Some(2); let y = Some(2); assert_eq!(x.xor(y), None); let x: Option = None; let y: Option = None; assert_eq!(x.xor(y), None); ``` -------------------------------- ### get_or_insert_default Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Illustrates inserting the default value for the type if the Option is None. ```rust let mut x = None; { let y: &mut u32 = x.get_or_insert_default(); assert_eq!(y, &0); *y = 7; } assert_eq!(x, Some(7)); ``` -------------------------------- ### Unsafe Get Value from CFDictionary Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFDictionary.html Gets a direct, unchecked reference to a value associated with a key. Use with caution as the dictionary must not be mutated while the reference is live. Consider `get` for safer access. ```rust pub unsafe fn get_unchecked(&self, key: &K) -> Option<&V> where K: Type + Sized, V: Type + Sized, ``` -------------------------------- ### take_if Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Shows taking the value from an Option only if a predicate returns true. ```rust let mut x = Some(42); let prev = x.take_if(|v| if *v == 42 { *v += 1; false } else { false }); assert_eq!(x, Some(43)); assert_eq!(prev, None); let prev = x.take_if(|v| *v == 43); assert_eq!(x, None); assert_eq!(prev, Some(43)); ``` -------------------------------- ### CFURLBookmarkResolutionOptions Initialization Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkResolutionOptions.html Methods for creating CFURLBookmarkResolutionOptions instances, including empty, all, from bits, and from name. ```rust pub const fn empty() -> Self ``` ```rust pub const fn all() -> Self ``` ```rust pub const fn bits(&self) -> CFOptionFlags ``` ```rust pub const fn from_bits(bits: CFOptionFlags) -> Option ``` ```rust pub const fn from_bits_truncate(bits: CFOptionFlags) -> Self ``` ```rust pub const fn from_bits_retain(bits: CFOptionFlags) -> Self ``` ```rust pub fn from_name(name: &str) -> Option ``` -------------------------------- ### Get First Mutable Element from Slice Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFNotificationCallback.html Shows how to get the first mutable element from a mutable slice obtained from an Option. ```Rust assert_eq!(Some(123).as_mut_slice().first_mut(), Some(&mut 123)) ``` -------------------------------- ### Get First Element as Slice Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFNotificationCallback.html Shows how to get the first element of an Option as a slice, useful for iterating over Option or slice. ```Rust for i in [Some(1234_u16), None] { assert_eq!(i.as_ref(), i.as_slice().first()); } ``` -------------------------------- ### Recommended Expect Message Style Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorCopyDescriptionCallBack.html Example showing a recommended style for expect() messages, focusing on the reason why the Option should be Some. ```Rust let item = slice.get(0) .expect("slice should not be empty"); ``` -------------------------------- ### Get CFType Reference (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFNull.html Deprecated helper for getting a CFType reference. This is redundant as CF types dereference to CFType. ```rust fn as_CFTypeRef(&self) -> &CFType> ``` -------------------------------- ### Create a New CGSize Instance Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CGSize.html Shows how to create a new `CGSize` instance using the `CGSize::new` associated function. It accepts width and height as arguments. Negative values are permitted, though often not desired. ```rust use objc2_core_foundation::CGSize; let size = CGSize::new(10.0, 2.3); assert_eq!(size.width, 10.0); assert_eq!(size.height, 2.3); ``` ```rust use objc2_core_foundation::CGSize; let size = CGSize::new(-1.0, 0.0); assert_eq!(size.width, -1.0); ``` -------------------------------- ### CFCalendarUnit Iterator Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFCalendarUnit.html Provides iterator methods for CFCalendarUnit. Use `iter` to get all defined flags and `iter_names` to get only named flags. ```rust pub const fn iter(&self) -> Iter ``` ```rust pub const fn iter_names(&self) -> IterNames ``` -------------------------------- ### insert Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Shows how to insert a value into an Option, replacing any existing value and returning a mutable reference. ```rust let mut opt = None; let val = opt.insert(1); assert_eq!(*val, 1); assert_eq!(opt.unwrap(), 1); let val = opt.insert(2); assert_eq!(*val, 2); *val = 3; assert_eq!(opt.unwrap(), 3); ``` -------------------------------- ### Get CFTypeID in Rust Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/fn.CFGetTypeID.html Demonstrates how to use the CFGetTypeID function to get the type identifier of a CFType object in Rust. This is useful for runtime type checking. ```rust pub extern "C-unwind" fn CFGetTypeID(cf: Option<&CFType>) -> CFTypeID ``` -------------------------------- ### wrap_under_create_rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFData.html Deprecated helper for easier transition from the `core-foundation` crate. Use `CFRetained::from_raw` instead. ```APIDOC ## unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained ### Description Deprecated: use `CFRetained::from_raw`. Helper for easier transition from the `core-foundation` crate. ### Method N/A (Deprecated unsafe function from `Type` trait) ### Parameters * **ptr**: A raw pointer to the object. ### Returns A `CFRetained` instance. ``` -------------------------------- ### Get Default Allocator (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/fn.CFAllocatorGetDefault.html This snippet shows how to get the default Core Foundation allocator. Note that this function is deprecated and should be replaced with `CFAllocator::default`. ```rust pub extern "C-unwind" fn CFAllocatorGetDefault() -> Option> ``` -------------------------------- ### replace Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Demonstrates replacing the value in an Option with a new value, returning the old value. ```rust let mut x = Some(2); let old = x.replace(5); assert_eq!(x, Some(5)); assert_eq!(old, Some(2)); ``` -------------------------------- ### CFRetained Seek Operations Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFRetained.html Provides methods for seeking within a CFRetained object. This includes setting the position, getting the current position, rewinding, and getting the stream length. ```APIDOC ## CFRetained Seek Operations ### Description Methods for seeking within a CFRetained object. ### Methods #### `seek(&mut self, pos: SeekFrom) -> Result` **Description:** Seek to an offset, in bytes, in a stream. #### `stream_position(&mut self) -> Result` **Description:** Returns the current seek position from the start of the stream. #### `rewind(&mut self) -> Result<(), Error>` **Description:** Rewind to the beginning of a stream. #### `stream_len(&mut self) -> Result` **Description:** Returns the length of this stream (in bytes). (Nightly-only experimental API) #### `seek_relative(&mut self, offset: i64) -> Result<(), Error>` **Description:** Seeks relative to the current position. ``` -------------------------------- ### or_else Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Demonstrates the use of `or_else` to provide a default value when an Option is None. ```rust assert_eq!(Some("barbarians").or_else(vikings), Some("barbarians")); assert_eq!(None.or_else(vikings), Some("vikings")); assert_eq!(None.or_else(nobody), None); ``` -------------------------------- ### get_unchecked Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFMutableDictionary.html Get a direct reference to one of the dictionary’s values. Consider using the `get` method instead, unless you’re seeing performance issues from the retaining. ```APIDOC ## get_unchecked ### Description Get a direct reference to one of the dictionary’s values. Consider using the `get` method instead, unless you’re seeing performance issues from the retaining. ### Safety The dictionary must not be mutated while the returned reference is live. ``` -------------------------------- ### get_or_insert_with Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Shows inserting a value computed by a closure if the Option is None. ```rust let mut x = None; { let y: &mut u32 = x.get_or_insert_with(|| 5); assert_eq!(y, &5); *y = 7; } assert_eq!(x, Some(7)); ``` -------------------------------- ### Type::wrap_under_create_rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFArray.html Deprecated helper for easier transition from the `core-foundation` crate. ```APIDOC ## Type::wrap_under_create_rule ### Description Deprecated: Helper for easier transition from the `core-foundation` crate. ### Method `wrap_under_create_rule` ### Signature `unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained` ### Constraints `where Self: Sized` ``` -------------------------------- ### CFBoolean Wrap Under Get Rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBoolean.html Deprecated helper for easier transition from the core-foundation crate. Wraps a raw pointer to CFBoolean under the get rule. Use CFRetained::retain instead. ```rust unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained where Self: Sized, ``` -------------------------------- ### Get a reference to the inner value with as_deref Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFArrayEqualCallBack.html Converts `Option` to `Option<&T::Target>` by coercing the inner value via `Deref`. This allows you to get a reference to the dereferenced type without consuming the original `Option`. ```rust let x: Option = Some("hey".to_owned()); assert_eq!(x.as_deref(), Some("hey")); ``` ```rust let x: Option = None; assert_eq!(x.as_deref(), None); ``` -------------------------------- ### CFURLBookmarkResolutionOptions Comparison Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkResolutionOptions.html Provides methods for comparing CFURLBookmarkResolutionOptions instances, including equality, ordering, and clamping values. ```APIDOC ## `impl Ord for CFURLBookmarkResolutionOptions` ### `fn cmp(&self, other: &CFURLBookmarkResolutionOptions) -> Ordering` Compares `self` and `other` and returns an `Ordering`. ### `fn max(self, other: Self) -> Self` Compares two values and returns the maximum. ### `fn min(self, other: Self) -> Self` Compares two values and returns the minimum. ### `fn clamp(self, min: Self, max: Self) -> Self` Restricts a value to a specified interval. ## `impl PartialEq for CFURLBookmarkResolutionOptions` ### `fn eq(&self, other: &CFURLBookmarkResolutionOptions) -> bool` Tests if `self` and `other` are equal. ### `fn ne(&self, other: &Rhs) -> bool` Tests if `self` and `other` are not equal. ## `impl PartialOrd for CFURLBookmarkResolutionOptions` ### `fn partial_cmp(&self, other: &CFURLBookmarkResolutionOptions) -> Option` Returns an ordering between `self` and `other` if one exists. ### `fn lt(&self, other: &Rhs) -> bool` Tests if `self` is less than `other`. ### `fn le(&self, other: &Rhs) -> bool` Tests if `self` is less than or equal to `other`. ### `fn gt(&self, other: &Rhs) -> bool` Tests if `self` is greater than `other`. ### `fn ge(&self, other: &Rhs) -> bool` Tests if `self` is greater than or equal to `other`. ``` -------------------------------- ### CGSize::new Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CGSize.html Creates a new CGSize instance with the specified width and height. Negative values are permitted. ```APIDOC ## pub const fn new(width: CGFloat, height: CGFloat) -> Self Create a new size with the given dimensions. ### Examples ```rust use objc2_core_foundation::CGSize; let size = CGSize::new(10.0, 2.3); assert_eq!(size.width, 10.0); assert_eq!(size.height, 2.3); ``` Negative values are allowed (though often undesired). ```rust use objc2_core_foundation::CGSize; let size = CGSize::new(-1.0, 0.0); assert_eq!(size.width, -1.0); ``` ``` -------------------------------- ### Wrap Under Get Rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/trait.Type.html Deprecated helper for transitioning from the `core-foundation` crate. Use `CFRetained::retain` instead. It wraps a raw pointer under the 'get' rule, similar to `CFRetained::retain`'s safety. ```rust unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained where Self: Sized ``` -------------------------------- ### name_of_encoding Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFString.html Gets the name of a given CFStringEncoding. ```APIDOC ## name_of_encoding ### Description Gets the name of a given CFStringEncoding. ### Method `pub fn name_of_encoding(encoding: CFStringEncoding) -> Option>` ### Parameters #### Path Parameters - `encoding` (CFStringEncoding) - Description: The encoding for which to get the name. ``` -------------------------------- ### Rust Option XOR Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFArrayRetainCallBack.html Demonstrates the XOR operation between two Option values. ```rust let x: Option = None; let y: Option = None; assert_eq!(x.xor(y), None); ``` -------------------------------- ### CFDate::absolute_time Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFDate.html Gets the CFAbsoluteTime of the CFDate. ```APIDOC ## CFDate::absolute_time ### Description Gets the `CFAbsoluteTime` of the `CFDate`. ### Method `pub fn absolute_time(&self) -> CFAbsoluteTime` ### Parameters None. ``` -------------------------------- ### Option::and_then Example (Chaining) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorDeallocateCallBack.html Demonstrates chaining fallible operations using and_then for safe access into nested structures like 2D arrays. ```rust let arr_2d = [["A0", "A1"], ["B0", "B1"]]; let item_0_1 = arr_2d.get(0).and_then(|row| row.get(1)); assert_eq!(item_0_1, Some(&"A1")); let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0)); assert_eq!(item_2_0, None); ``` -------------------------------- ### Get CFNumberFormatter Style Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFNumberFormatter.html Retrieves the style of a CFNumberFormatter. ```rust pub fn style(&self) -> CFNumberFormatterStyle ``` -------------------------------- ### Option::ok_or_else Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorDeallocateCallBack.html Demonstrates converting an Option to a Result using a closure to provide the error value. ```rust let x: Option<&str> = None; assert_eq!(x.ok_or_else(|| 0), Err(0)); ``` -------------------------------- ### new Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFStringTokenizer.html Creates a tokenizer instance. This method is available only with the `CFLocale` crate feature. ```APIDOC ## new ### Description Creates a tokenizer instance. This method is available only with the `CFLocale` crate feature. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method - None (This is a function call) ### Endpoint - None (This is a function call) ### Parameters - **alloc** (`Option<&CFAllocator>`): The CFAllocator which should be used to allocate memory for the tokenizer and its storage for values. This parameter may be NULL in which case the current default CFAllocator is used. - **string** (`Option<&CFString>`): The string to tokenize. - **range** (`CFRange`): The range of characters within the string to be tokenized. The specified range must not exceed the length of the string. - **options** (`CFOptionFlags`): Use one of the Tokenization Unit options to specify how the string should be tokenized. Optionally specify one or more attribute specifiers to tell the tokenizer to prepare specified attributes when it tokenizes the string. - **locale** (`Option<&CFLocale>`): The locale to specify language or region specific behavior. Pass NULL if you want tokenizer to identify the locale automatically. ### Returns - `Option>`: A reference to the new CFStringTokenizer. ### Safety - `alloc` might not allow `None`. - `string` might not allow `None`. - `locale` might not allow `None`. ``` -------------------------------- ### Get CFMessagePort Name Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFMessagePort.html Retrieves the name of the CFMessagePort. ```rust pub fn name(&self) -> Option> ``` -------------------------------- ### Type::wrap_under_get_rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFArray.html Deprecated helper for easier transition from the `core-foundation` crate. ```APIDOC ## Type::wrap_under_get_rule ### Description Deprecated: Helper for easier transition from the `core-foundation` crate. ### Method `wrap_under_get_rule` ### Signature `unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained` ### Constraints `where Self: Sized` ``` -------------------------------- ### has_prefix Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFMutableString.html Checks if the CFString starts with a specified prefix. ```APIDOC ## has_prefix ### Description Checks if the CFString starts with a specified prefix. ### Method `has_prefix(&self, prefix: Option<&CFString>) -> bool` ### Parameters * `prefix` (Option<&CFString>) - The prefix to check for. ### Returns `bool` - True if the string starts with the prefix, false otherwise. ``` -------------------------------- ### CFCalendarGetTimeRangeOfUnit Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/fn.CFCalendarGetTimeRangeOfUnit.html This C function retrieves the start time and duration of a specified calendar unit at a given absolute time. It returns a boolean indicating success and populates the `startp` and `tip` pointers with the start time and time interval, respectively. This function is deprecated. ```APIDOC ## CFCalendarGetTimeRangeOfUnit ### Description Retrieves the start time and duration of a specified calendar unit at a given absolute time. It returns a boolean indicating success and populates the `startp` and `tip` pointers with the start time and time interval, respectively. This function is deprecated. ### Signature ``` pub unsafe extern "C-unwind" fn CFCalendarGetTimeRangeOfUnit( calendar: &CFCalendar, unit: CFCalendarUnit, at: CFAbsoluteTime, startp: *mut CFAbsoluteTime, tip: *mut CFTimeInterval, ) -> bool ``` ### Deprecated This function is deprecated and has been renamed to `CFCalendar::time_range_of_unit`. ### Availability Available on crate features `CFCalendar` and `CFDate` only. ``` -------------------------------- ### Initialize CGSize with ZERO Constant Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CGSize.html Demonstrates the usage of the `CGSize::ZERO` constant, which represents a size with both width and height set to 0.0. This is useful for initializing a default or empty size. ```rust use objc2_core_foundation::CGSize; assert_eq!(CGSize::ZERO, CGSize { width: 0.0, height: 0.0 }); ``` -------------------------------- ### Get Package Info in Directory Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves package type and creator information for a bundle at a given URL. Requires the 'CFURL' feature. This is an unsafe function. ```rust pub unsafe fn package_info_in_directory( url: Option<&CFURL>, package_type: *mut u32, package_creator: *mut u32, ) -> bool ``` -------------------------------- ### Get Fragment of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the fragment component of a URL. ```rust pub fn fragment(&self, characters_to_leave_escaped: Option<&CFString>) -> Option> ``` -------------------------------- ### Get Password of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the password component of a URL. ```rust pub fn password(&self) -> Option> ``` -------------------------------- ### wrap_under_get_rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFData.html Deprecated helper for easier transition from the `core-foundation` crate. Use `CFRetained::retain` instead. ```APIDOC ## unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained ### Description Deprecated: use `CFRetained::retain`. Helper for easier transition from the `core-foundation` crate. ### Method N/A (Deprecated unsafe function from `Type` trait) ### Parameters * **ptr**: A raw pointer to the object. ### Returns A `CFRetained` instance. ``` -------------------------------- ### Create a New CGRect Instance Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CGRect.html Demonstrates how to create a new CGRect instance using the `new` associated function, specifying the origin and size. Requires importing CGPoint, CGRect, and CGSize. ```rust use objc2_core_foundation::{CGPoint, CGRect, CGSize}; let origin = CGPoint::new(10.0, -2.3); let size = CGSize::new(5.0, 0.0); let rect = CGRect::new(origin, size); ``` -------------------------------- ### Get Path of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the path component of a URL. ```rust pub fn path(&self) -> Option> ``` -------------------------------- ### Create CFURLEnumerator for Mounted Volumes Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLEnumerator.html Initializes a CFURLEnumerator for mounted volumes. Requires the `CFArray` crate feature. Pay attention to safety requirements for `alloc` and `property_keys`. ```rust pub unsafe fn new_for_mounted_volumes( alloc: Option<&CFAllocator>, option: CFURLEnumeratorOptions, property_keys: Option<&CFArray>, ) -> Option> ``` -------------------------------- ### Get Scheme of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the scheme component of a URL. ```rust pub fn scheme(&self) -> Option> ``` -------------------------------- ### CFString Fastest Encoding Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFString.html Gets the fastest encoding for a CFString. ```APIDOC ## pub fn fastest_encoding(&self) -> CFStringEncoding ### Description Gets the fastest encoding for a CFString. ### Method GET (Conceptual) ### Endpoint N/A (Method on an object) ### Parameters None ### Response #### Success Response (CFStringEncoding) - **encoding** (CFStringEncoding) - The fastest character encoding. ``` -------------------------------- ### Create and Inspect a CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Demonstrates how to create a CFURL from a string and extract its scheme, host name, and path. This is useful for parsing and validating URL components. ```rust use objc2_core_foundation::{ CFString, CFURL, CFURLCopyHostName, CFURLCopyScheme, CFURLCopyPath, }; let url = CFURL::from_string(None, &CFString::from_str("http://example.com/foo"), None).unwrap(); assert_eq!(url.string().to_string(), "http://example.com/foo"); assert_eq!(CFURLCopyScheme(&url).unwrap().to_string(), "http"); assert_eq!(CFURLCopyHostName(&url).unwrap().to_string(), "example.com"); assert_eq!(CFURLCopyPath(&url).unwrap().to_string(), "/foo"); ``` -------------------------------- ### CFISO8601DateFormatOptions Initialization Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFISO8601DateFormatOptions.html Provides methods to create CFISO8601DateFormatOptions instances, including empty, all flags set, from raw bits, and from a flag name. ```rust pub const fn empty() -> Self ``` ```rust pub const fn all() -> Self ``` ```rust pub const fn from_bits(bits: CFOptionFlags) -> Option ``` ```rust pub const fn from_bits_truncate(bits: CFOptionFlags) -> Self ``` ```rust pub const fn from_bits_retain(bits: CFOptionFlags) -> Self ``` ```rust pub fn from_name(name: &str) -> Option ``` -------------------------------- ### Get CFWriteStream Property Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFWriteStream.html Retrieves a property of the CFWriteStream by its name. ```rust pub fn property( &self, property_name: Option<&CFStreamPropertyKey>, ) -> Option> ``` -------------------------------- ### Get CFUUID Bytes Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFUUID.html Retrieves the 16-byte representation of a CFUUID. ```rust pub fn uuid_bytes(&self) -> CFUUIDBytes ``` -------------------------------- ### Rust Option map Example Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFArrayReleaseCallBack.html Shows how to use the map method to transform the contained value of an Option if it is Some, or return None if it is None. ```rust let maybe_some_string = Some(String::from("Hello, World!")); let maybe_some_len = maybe_some_string.map(|s| s.len()); assert_eq!(maybe_some_len, Some(13)); let x: Option<&str> = None; assert_eq!(x.map(|s| s.len()), None); ``` -------------------------------- ### Create Bundles from Directory Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Creates CFBundle instances from a directory. Requires 'CFArray' and 'CFURL' features. Allows filtering by bundle type. ```rust pub fn new_bundles_from_directory( allocator: Option<&CFAllocator>, directory_url: Option<&CFURL>, bundle_type: Option<&CFString>, ) -> Option> ``` -------------------------------- ### Get CFReadStream Property Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFReadStream.html Retrieves a specific property of the CFReadStream. ```rust pub fn property( &self, property_name: Option<&CFStreamPropertyKey>, ) -> Option> ``` -------------------------------- ### Get CFRunLoopObserver Activities Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFRunLoopObserver.html Retrieves the activities that the CFRunLoopObserver is monitoring. ```rust pub fn activities(&self) -> CFOptionFlags ``` -------------------------------- ### CFURLBookmarkCreationOptions Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html These methods provide functionality to create, manipulate, and query flag values for CFURLBookmarkCreationOptions. ```APIDOC ## CFURLBookmarkCreationOptions Methods ### Description Methods for creating, manipulating, and querying flag values. ### Static Methods - **`empty()`**: Returns a flags value with all bits unset. - **`all()`**: Returns a flags value with all known bits set. - **`from_bits(bits: CFOptionFlags)`**: Converts from a `CFOptionFlags` value. Returns `None` if any unknown bits are set. - **`from_bits_truncate(bits: CFOptionFlags)`**: Converts from a `CFOptionFlags` value, unsetting any unknown bits. - **`from_bits_retain(bits: CFOptionFlags)`**: Converts from a `CFOptionFlags` value exactly. - **`from_name(name: &str)`**: Gets a flags value with the bits of a flag with the given name set. Returns `None` if `name` is empty or doesn’t correspond to any named flag. ### Instance Methods - **`bits(&self)`**: Returns the underlying bits value. - **`is_empty(&self)`**: Returns `true` if all bits in `self` are unset. - **`is_all(&self)`**: Returns `true` if all known bits in this flags value are set. - **`intersects(&self, other: Self)`**: Returns `true` if any set bits in `other` are also set in `self`. - **`contains(&self, other: Self)`**: Returns `true` if all set bits in `other` are also set in `self`. - **`insert(&mut self, other: Self)`**: Performs a bitwise OR operation with `other`. - **`remove(&mut self, other: Self)`**: Performs a bitwise AND NOT operation with `other`. - **`toggle(&mut self, other: Self)`**: Performs a bitwise XOR operation with `other`. - **`set(&mut self, other: Self, value: bool)`**: Inserts `other` if `value` is `true`, removes it otherwise. - **`intersection(self, other: Self)`**: Returns the bitwise AND of `self` and `other`. - **`union(self, other: Self)`**: Returns the bitwise OR of `self` and `other`. - **`difference(self, other: Self)`**: Returns the bitwise AND NOT of `self` and `other`. - **`symmetric_difference(self, other: Self)`**: Returns the bitwise XOR of `self` and `other`. - **`complement(self)`**: Returns the bitwise negation of `self`, truncating the result. ### Iterators - **`iter(&self)`**: Yields a set of contained flags values, including any unknown bits. - **`iter_names(&self)`**: Yields a set of contained named flags values, excluding unknown bits. ``` -------------------------------- ### Wrap Under Create Rule (Deprecated) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/trait.Type.html Deprecated helper for transitioning from the `core-foundation` crate. Use `CFRetained::from_raw` instead. It wraps a raw pointer under the 'create' rule, with safety equivalent to `CFRetained::from_raw`. ```rust unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained where Self: Sized ``` -------------------------------- ### Get CFReadStream Status Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFReadStream.html Retrieves the current status of the CFReadStream. ```rust pub fn status(&self) -> CFStreamStatus ``` -------------------------------- ### type_id Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Gets the unique `CFTypeID` identifier for the `CFBundle` type. ```APIDOC ## type_id ### Description Get the unique `CFTypeID` identifier for the type `CFBundle`. ### Method `type_id` ### Returns A `CFTypeID` representing the unique identifier for the `CFBundle` type. ``` -------------------------------- ### and Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Returns `None` if the option is `None`, otherwise returns the provided `optb`. ```APIDOC ## and ### Description Returns `None` if the option is `None`, otherwise returns `optb`. Arguments passed to `and` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use `and_then`, which is lazily evaluated. ### Method `and` ### Parameters * `optb`: `Option` - The option to return if the original option is `Some`. ### Returns `Option` ### Examples ```rust let x = Some(2); let y: Option<&str> = None; assert_eq!(x.and(y), None); let x: Option = None; let y = Some("foo"); assert_eq!(x.and(y), None); let x = Some(2); let y = Some("foo"); assert_eq!(x.and(y), Some("foo")); let x: Option = None; let y: Option<&str> = None; assert_eq!(x.and(y), None); ``` ``` -------------------------------- ### CFType::retain_count Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFDate.html Gets the reference count of the CFDate object. ```APIDOC ## CFType::retain_count ### Description Gets 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. ### Method `pub fn retain_count(&self) -> usize` ### Parameters None. ``` -------------------------------- ### Copy, Eq, and StructuralPartialEq Implementations for CFURLBookmarkCreationOptions Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Indicates that CFURLBookmarkCreationOptions is copyable, supports exact equality comparison, and structural partial equality comparison. ```APIDOC ## Copy, Eq, and StructuralPartialEq for CFURLBookmarkCreationOptions ### Traits Implemented - `Copy`: Allows instances of `CFURLBookmarkCreationOptions` to be copied implicitly. - `Eq`: Guarantees that equality comparison is reflexive, symmetric, and transitive. - `StructuralPartialEq`: Supports structural partial equality comparison. ``` -------------------------------- ### Get Development Region Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves the development region of the bundle. ```rust pub fn development_region(&self) -> Option> ``` -------------------------------- ### Get Bundle Identifier Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves the unique identifier of the bundle. ```rust pub fn identifier(&self) -> Option> ``` -------------------------------- ### fmt for CFURLBookmarkCreationOptions (Binary) Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Formats the CFURLBookmarkCreationOptions value using the given formatter. ```APIDOC ## fn fmt(&self, f: &mut Formatter<'_>) -> Result ### Description Formats the value using the given formatter. ### Parameters * `f`: A mutable reference to a `Formatter` to write the formatted output to. ### Returns A `Result` indicating success or failure of the formatting operation. ``` -------------------------------- ### ConcreteType Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFStreamPropertyKey.html Provides a method to get the unique CFTypeID identifier for CFString. ```APIDOC ## ConcreteType for CFString ### Description Get the unique `CFTypeID` identifier for the type. ### Method `type_id` ### Parameters None ### Returns `CFTypeID` ``` -------------------------------- ### and Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorRetainCallBack.html Returns `None` if the option is `None`, otherwise returns `optb`. Arguments passed to `and` are eagerly evaluated. ```APIDOC ## pub fn and(self, optb: Option) -> Option ### Description Returns `None` if the option is `None`, otherwise returns `optb`. Arguments passed to `and` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use `and_then`, which is lazily evaluated. ### Method `and` ### Parameters - **optb** (Option): The second option to return if the first option is `Some`. ### Response #### Success Response - `Option`: Returns `optb` if `self` is `Some`, otherwise returns `None`. ### Request Example ```rust let x = Some(2); let y: Option<&str> = None; assert_eq!(x.and(y), None); let x: Option = None; let y = Some("foo"); assert_eq!(x.and(y), None); let x = Some(2); let y = Some("foo"); assert_eq!(x.and(y), Some("foo")); let x: Option = None; let y: Option<&str> = None; assert_eq!(x.and(y), None); ``` ``` -------------------------------- ### Get Info Dictionary Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves the entire info dictionary for the bundle. Requires the 'CFDictionary' feature. ```rust pub fn info_dictionary(&self) -> Option> ``` -------------------------------- ### type_id Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CGRect.html Gets the `TypeId` of `self`. This is useful for runtime type identification. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters - `&self`: An immutable reference to the object. ### Returns - `TypeId`: The unique identifier for the type of `self`. ``` -------------------------------- ### Get Path Extension of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the path extension of a URL. ```rust pub fn path_extension(&self) -> Option> ``` -------------------------------- ### Ord Implementation for CFURLBookmarkCreationOptions Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Provides methods for ordering CFURLBookmarkCreationOptions values, including comparison, finding the maximum/minimum, and clamping values within an interval. ```APIDOC ## Ord for CFURLBookmarkCreationOptions ### Methods #### `cmp(&self, other: &CFURLBookmarkCreationOptions) -> Ordering` Compares `self` with `other` and returns an `Ordering`. #### `max(self, other: Self) -> Self` Compares two values and returns the maximum. #### `min(self, other: Self) -> Self` Compares two values and returns the minimum. #### `clamp(self, min: Self, max: Self) -> Self` Restricts a value to a specified interval [`min`, `max`]. ``` -------------------------------- ### CFURLBookmarkResolutionOptions Methods Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkResolutionOptions.html Provides methods for creating, manipulating, and querying flag values for CFURL bookmark resolution options. These methods allow for operations like checking for empty or all bits set, converting from raw bits, and performing set operations. ```APIDOC ## CFURLBookmarkResolutionOptions Methods ### `empty()` Get a flags value with all bits unset. ### `all()` Get a flags value with all known bits set. ### `bits(&self)` Get the underlying bits value. The returned value is exactly the bits set in this flags value. ### `from_bits(bits: CFOptionFlags)` Convert from a bits value. This method will return `None` if any unknown bits are set. ### `from_bits_truncate(bits: CFOptionFlags)` Convert from a bits value, unsetting any unknown bits. ### `from_bits_retain(bits: CFOptionFlags)` Convert from a bits value exactly. ### `from_name(name: &str)` Get a flags value with the bits of a flag with the given name set. This method will return `None` if `name` is empty or doesn’t correspond to any named flag. ### `is_empty(&self)` Whether all bits in `self` are unset. ### `is_all(&self)` Whether all known bits in this flags value are set. ### `intersects(&self, other: Self)` Whether any set bits in `other` are also set in `self`. ### `contains(&self, other: Self)` Whether all set bits in `other` are also set in `self`. ### `insert(&mut self, other: Self)` The bitwise or (`|`) of the bits in `self` and `other`. ### `remove(&mut self, other: Self)` The intersection of `self` with the complement of `other` (`&!`). This method is not equivalent to `self & !other` when `other` has unknown bits set. `remove` won’t truncate `other`, but the `!` operator will. ### `toggle(&mut self, other: Self)` The bitwise exclusive-or (`^`) of the bits in `self` and `other`. ### `set(&mut self, other: Self, value: bool)` Call `insert` when `value` is `true` or `remove` when `value` is `false`. ### `intersection(self, other: Self)` The bitwise and (`&`) of the bits in `self` and `other`. ### `union(self, other: Self)` The bitwise or (`|`) of the bits in `self` and `other`. ### `difference(self, other: Self)` The intersection of `self` with the complement of `other` (`&!`). This method is not equivalent to `self & !other` when `other` has unknown bits set. `difference` won’t truncate `other`, but the `!` operator will. ### `symmetric_difference(self, other: Self)` The bitwise exclusive-or (`^`) of the bits in `self` and `other`. ### `complement(self)` The bitwise negation (`!`) of the bits in `self`, truncating the result. ``` -------------------------------- ### Get Port Number of CFURL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURL.html Retrieves the port number of a URL. ```rust pub fn port_number(&self) -> i32 ``` -------------------------------- ### Get CFXMLNode Version Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFXMLNode.html Retrieves the version of a CFXMLNode. This method is deprecated. ```rust pub fn version(&self) -> CFIndex ``` -------------------------------- ### PartialEq Implementation for CFURLBookmarkCreationOptions Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Defines equality testing for CFURLBookmarkCreationOptions values. ```APIDOC ## PartialEq for CFURLBookmarkCreationOptions ### Methods #### `eq(&self, other: &CFURLBookmarkCreationOptions) -> bool` Tests if `self` and `other` are equal. Used by the `==` operator. #### `ne(&self, other: &Rhs) -> bool` Tests if `self` and `other` are not equal. Used by the `!=` operator. ``` -------------------------------- ### Create CFBundle Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Creates a new CFBundle instance with a specified allocator and bundle URL. Requires the 'CFURL' feature. ```rust pub fn new( allocator: Option<&CFAllocator>, bundle_url: Option<&CFURL>, ) -> Option> ``` -------------------------------- ### Get Descendant Level Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLEnumerator.html Returns the current descendant level of the CFURLEnumerator. ```rust pub fn descendent_level(&self) -> CFIndex ``` -------------------------------- ### Get CFSocket Flags Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFSocket.html Retrieves the current socket flags for the CFSocket. ```rust pub fn socket_flags(&self) -> CFOptionFlags ``` -------------------------------- ### Get Info Dictionary in Directory Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves the info dictionary for a bundle located at a given URL. Requires 'CFDictionary' and 'CFURL' features. ```rust pub fn info_dictionary_in_directory( bundle_url: Option<&CFURL>, ) -> Option> ``` -------------------------------- ### Example of into_flat_iter for Option Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFAllocatorAllocateCallBack.html Demonstrates transforming an optional iterator into a flat iterator. This is useful for handling Option types. ```rust #![feature(option_into_flat_iter)] let o1 = Some([1, 2]); let o2 = None::<&[usize]>; assert_eq!(o1.into_flat_iter().collect::>(), [1, 2]); assert_eq!(o2.into_flat_iter().collect::>(), Vec::<&usize>::new()); ``` -------------------------------- ### Get Native Socket Handle Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFSocket.html Returns the native handle of the CFSocket. ```rust pub fn native(&self) -> CFSocketNativeHandle ``` -------------------------------- ### Initialization Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFPropertyListMutabilityOptions.html Methods for creating CFPropertyListMutabilityOptions values. ```APIDOC ## Initialization ### `empty()` `pub const fn empty() -> Self` Get a flags value with all bits unset. ### `all()` `pub const fn all() -> Self` Get a flags value with all known bits set. ### `from_bits(bits: CFOptionFlags) -> Option` `pub const fn from_bits(bits: CFOptionFlags) -> Option` Convert from a bits value. This method will return `None` if any unknown bits are set. ### `from_bits_truncate(bits: CFOptionFlags) -> Self` `pub const fn from_bits_truncate(bits: CFOptionFlags) -> Self` Convert from a bits value, unsetting any unknown bits. ### `from_bits_retain(bits: CFOptionFlags) -> Self` `pub const fn from_bits_retain(bits: CFOptionFlags) -> Self` Convert from a bits value exactly. ### `from_name(name: &str) -> Option` `pub fn from_name(name: &str) -> Option` Get a flags value with the bits of a flag with the given name set. This method will return `None` if `name` is empty or doesn’t correspond to any named flag. ``` -------------------------------- ### CFPlugInInstance::factory_name Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFPlugInInstance.html Gets the name of the factory associated with the plug-in instance. ```APIDOC ## CFPlugInInstance::factory_name ### Description Retrieves the name of the factory that created this plug-in instance. ### Method `pub fn factory_name(&self) -> Option>` ### Parameters * `&self`: A reference to the `CFPlugInInstance`. ### Returns An `Option` containing a `CFRetained` with the factory name if available, otherwise `None`. ``` -------------------------------- ### type_id Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFNumberType.html Gets the `TypeId` of `self`. This method is part of the blanket implementation of `Any` for `T`. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters - `self` (Self) - An immutable reference to the object. ### Returns - `TypeId` - The unique type identifier of the object. ``` -------------------------------- ### default Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/type.CFBagApplierFunction.html Returns `None` for an `Option` type. ```APIDOC ## pub fn default() -> Option ### Description Returns `None`. ### Method `default` ### Parameters None ### Request Example ```rust let opt: Option = Option::default(); assert!(opt.is_none()); ``` ### Response #### Success Response - `Option` - Always returns `None`. #### Response Example ```json { "example": "None" } ``` ``` -------------------------------- ### CFURLBookmarkCreationOptions Struct Definition Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Defines the CFURLBookmarkCreationOptions struct, which wraps CFOptionFlags for bookmark creation. Available only when the 'CFURL' crate feature is enabled. ```rust #[repr(transparent)] pub struct CFURLBookmarkCreationOptions(pub CFOptionFlags); ``` -------------------------------- ### ConcreteType Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFFileSecurity.html Provides a method to get the unique CFTypeID identifier for the type. ```APIDOC ## fn type_id() -> CFTypeID Get the unique `CFTypeID` identifier for the type. ``` -------------------------------- ### Get CFError Code Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFError.html Retrieves the error code associated with a CFError. ```rust pub fn code(&self) -> CFIndex ``` -------------------------------- ### Create CFURLEnumerator for Directory URL Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLEnumerator.html Initializes a CFURLEnumerator for a specific directory URL. Requires `CFArray` and `CFURL` crate features. Ensure safety by providing valid pointers and types. ```rust pub unsafe fn new_for_directory_url( alloc: Option<&CFAllocator>, directory_url: Option<&CFURL>, option: CFURLEnumeratorOptions, property_keys: Option<&CFArray>, ) -> Option> ``` -------------------------------- ### Get Version Number Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFBundle.html Retrieves the version number of the bundle as a u32. ```rust pub fn version_number(&self) -> u32 ``` -------------------------------- ### PartialOrd Implementation for CFURLBookmarkCreationOptions Source: https://docs.rs/objc2-core-foundation/latest/objc2_core_foundation/struct.CFURLBookmarkCreationOptions.html Provides partial ordering comparisons for CFURLBookmarkCreationOptions values. ```APIDOC ## PartialOrd for CFURLBookmarkCreationOptions ### Methods #### `partial_cmp(&self, other: &CFURLBookmarkCreationOptions) -> Option` Returns an ordering between `self` and `other` if one exists. #### `lt(&self, other: &Rhs) -> bool` Tests if `self` is less than `other`. Used by the `<` operator. #### `le(&self, other: &Rhs) -> bool` Tests if `self` is less than or equal to `other`. Used by the `<=` operator. #### `gt(&self, other: &Rhs) -> bool` Tests if `self` is greater than `other`. Used by the `>` operator. #### `ge(&self, other: &Rhs) -> bool` Tests if `self` is greater than or equal to `other`. Used by the `>=` operator. ```