pub struct Text { /* private fields */ }Expand description
Text detection result with content and metadata.
Implementations§
Source§impl Text
impl Text
Sourcepub fn into_text(self) -> String
pub fn into_text(self) -> String
Consumes self and returns the text field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns the owned value of type String.
§Example
let obj = Text::default().with_text(value);
let value = obj.into_text();
// obj is now consumed and cannot be usedGenerated by aksr - Builder pattern macro
Sourcepub fn take_text(&mut self) -> String
pub fn take_text(&mut self) -> String
Takes the text field and replaces it with Default::default().
This method moves the value out and replaces it with the default value, allowing you to continue using the struct.
§Returns
Returns the owned value of type String.
§Note
Requires the field type String to implement Default. Prefer this when you want to keep using the instance.
§Example
let mut obj = Text::default().with_text(value);
let value = obj.take_text();
// obj.text is now set to Default::default()Generated by aksr - Builder pattern macro
Sourcepub fn with_meta(self, x: InstanceMeta) -> Self
pub fn with_meta(self, x: InstanceMeta) -> Self
Sourcepub fn meta(&self) -> &InstanceMeta
pub fn meta(&self) -> &InstanceMeta
Sourcepub fn into_meta(self) -> InstanceMeta
pub fn into_meta(self) -> InstanceMeta
Consumes self and returns the meta field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns the owned value of type InstanceMeta.
§Example
let obj = Text::default().with_meta(value);
let value = obj.into_meta();
// obj is now consumed and cannot be usedGenerated by aksr - Builder pattern macro
Sourcepub fn with_style(self, x: TextStyle) -> Self
pub fn with_style(self, x: TextStyle) -> Self
Sets the optional style field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Text::default().with_style(value);Generated by aksr - Builder pattern macro
Sourcepub fn into_style(self) -> Option<TextStyle>
pub fn into_style(self) -> Option<TextStyle>
Consumes self and returns the style field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns Option
§Example
let obj = Text::default().with_style(value);
let value = obj.into_style();Generated by aksr - Builder pattern macro
Sourcepub fn take_style(&mut self) -> Option<TextStyle>
pub fn take_style(&mut self) -> Option<TextStyle>
Takes the style field, leaving None in its place.
This method moves the value out and replaces it with None, allowing you to continue using the struct.
§Returns
Returns Option
§Note
This does not require the inner type to implement Default.
§Example
let mut obj = Text::default().with_style(value);
let value = obj.take_style();
// obj.style is now NoneGenerated by aksr - Builder pattern macro
Source§impl Text
impl Text
pub fn with_track_id(self, track_id: usize) -> Self
pub fn track_id(&self) -> Option<usize>
pub fn with_uid(self, uid: usize) -> Self
pub fn with_id(self, id: usize) -> Self
pub fn with_name(self, name: &str) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
pub fn uid(&self) -> usize
pub fn name(&self) -> Option<&str>
pub fn confidence(&self) -> Option<f32>
pub fn id(&self) -> Option<usize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.