pub struct LSMResult { /* private fields */ }Expand description
An opaque Core Foundation type representing the result of a lookup (immutable).
See also Apple’s documentation
Implementations§
Source§impl LSMResult
impl LSMResult
Sourcepub unsafe fn new(
alloc: Option<&CFAllocator>,
mapref: &LSMMap,
textref: &LSMText,
num_results: CFIndex,
flags: CFOptionFlags,
) -> CFRetained<LSMResult>
pub unsafe fn new( alloc: Option<&CFAllocator>, mapref: &LSMMap, textref: &LSMText, num_results: CFIndex, flags: CFOptionFlags, ) -> CFRetained<LSMResult>
Returns, in decreasing order of likelihood, the categories or words that best match when a text is mapped into a map.
Source§impl LSMResult
impl LSMResult
Sourcepub unsafe fn category(&self, n: CFIndex) -> LSMCategory
pub unsafe fn category(&self, n: CFIndex) -> LSMCategory
Returns the category of the n-th best (zero based) result.
Sourcepub unsafe fn score(&self, n: CFIndex) -> c_float
pub unsafe fn score(&self, n: CFIndex) -> c_float
Returns the likelihood of the n-th best (zero based) result. A nan score often indicates that the category does not contain any token.
Sourcepub unsafe fn word(&self, n: CFIndex) -> Option<CFRetained<CFString>>
pub unsafe fn word(&self, n: CFIndex) -> Option<CFRetained<CFString>>
Returns the word for the n-th best (zero based) result.
Sourcepub unsafe fn token(&self, n: CFIndex) -> Option<CFRetained<CFData>>
pub unsafe fn token(&self, n: CFIndex) -> Option<CFRetained<CFData>>
Returns the token for the n-th best (zero based) result.
Sourcepub unsafe fn word_cluster(&self, n: CFIndex) -> Option<CFRetained<CFArray>>
pub unsafe fn word_cluster(&self, n: CFIndex) -> Option<CFRetained<CFArray>>
Returns the cluster of words for the n-th best (zero based) result.
Sourcepub unsafe fn token_cluster(&self, n: CFIndex) -> Option<CFRetained<CFArray>>
pub unsafe fn token_cluster(&self, n: CFIndex) -> Option<CFRetained<CFArray>>
Returns the cluster of tokens for the n-th best (zero based) result.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
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.
Sourcepub fn retain_count(&self) -> usize
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 ConcreteType for LSMResult
impl ConcreteType for LSMResult
Source§impl RefEncode for LSMResult
impl RefEncode for LSMResult
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for LSMResult
impl Type for LSMResult
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more