[−][src]Struct egg_mode::service::Configuration
Represents a service configuration from Twitter.
The values returned in this struct are various pieces of information that, while they don't change often, have the opportunity to change over time and affect things like character counting or whether to route a twitter.com URL to a user lookup or a browser.
While tweets themselves still have a fixed 280-character limit, direct messages have had their
text limit expanded to 10,000 characters, and that length is communicated here, in
dm_text_character_limit.
For photo_sizes, note that if your image is smaller than the dimensions given for a particular
size, that size variant will simply return your source image as-is. If either dimension is
larger than its corresponding dimension here, it will be scaled according to the included
resize property. In practice this usually means thumb will crop to its dimensions, and each
other variant will resize down, keeping its aspect ratio.
For best ways to handle the short_url_length fields, see Twitter's documentation on t.co
URLs. In short, every URL Twitter detects in a new tweet or direct message gets a new t.co
URL created for it, which replaces the original URL in the given text. This affects character
counts for these fields, so if your app is counting characters and detects a URL for these
fields, treat the whole URL as if it were as long as the number of characters given in this
struct.
Finally, loading non_username_paths allows you to handle twitter.com/[name] links as if they
were a user mention, while still keeping site-level links working properly.
Fields
dm_text_character_limit: i32The character limit in direct messages.
photo_sizes: MediaSizesThe maximum dimensions for each photo size variant.
short_url_length: i32The maximum length for a t.co URL when given a URL with protocol http.
short_url_length_https: i32The maximum length for a t.co URL when given a URL with protocol https.
non_username_paths: Vec<String>A list of URL slugs that are not valid usernames when in a URL like twitter.com/[slug].
Trait Implementations
impl Debug for Configuration[src]
impl<'de> Deserialize<'de> for Configuration[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,