[−][src]Struct twitter_text::TwitterTextParseResults
A struct that represents a parsed tweet containing the length of the tweet, its validity, display ranges etc. The name mirrors Twitter's Java implementation.
Fields
weighted_length: i32
The weighted length is the number used to determine the tweet's length for the purposes of Twitter's limit of 280. Most characters count for 2 units, while a few ranges (like ASCII and Latin-1) count for 1. See Twitter's blog post.
permillage: i32
The weighted length expressed as a number relative to a limit of 1000. This value makes it easier to implement UI like Twitter's tweet-length meter.
is_valid: bool
Whether the tweet is valid: its weighted length must be under the configured limit, it must not be empty, and it must not contain invalid characters.
display_text_range: Range
The display range expressed in UTF-16.
valid_text_range: Range
The valid display range expressed in UTF-16. After the end of the valid range, clients typically stop highlighting entities, etc.
Implementations
impl TwitterTextParseResults
[src]
pub fn new(
weighted_length: i32,
permillage: i32,
is_valid: bool,
display_text_range: Range,
valid_text_range: Range
) -> TwitterTextParseResults
[src]
weighted_length: i32,
permillage: i32,
is_valid: bool,
display_text_range: Range,
valid_text_range: Range
) -> TwitterTextParseResults
A new TwitterTextParseResults struct with all fields supplied as arguments.
pub fn empty() -> TwitterTextParseResults
[src]
An invalid TwitterTextParseResults struct. This function produces the return value when empty text or invalid UTF-8 is supplied to parse().
Trait Implementations
impl Clone for TwitterTextParseResults
[src]
fn clone(&self) -> TwitterTextParseResults
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for TwitterTextParseResults
[src]
impl Debug for TwitterTextParseResults
[src]
impl Eq for TwitterTextParseResults
[src]
impl Hash for TwitterTextParseResults
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<TwitterTextParseResults> for TwitterTextParseResults
[src]
fn eq(&self, other: &TwitterTextParseResults) -> bool
[src]
fn ne(&self, other: &TwitterTextParseResults) -> bool
[src]
impl StructuralEq for TwitterTextParseResults
[src]
impl StructuralPartialEq for TwitterTextParseResults
[src]
Auto Trait Implementations
impl RefUnwindSafe for TwitterTextParseResults
impl Send for TwitterTextParseResults
impl Sync for TwitterTextParseResults
impl Unpin for TwitterTextParseResults
impl UnwindSafe for TwitterTextParseResults
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,