[][src]Struct egg_mode::tweet::DraftTweet

pub struct DraftTweet<'a> { /* fields omitted */ }

Represents an in-progress tweet before it is sent.

This is your entry point to posting new tweets to Twitter. To begin, make a new DraftTweet by calling new with your desired status text:

use egg_mode::tweet::DraftTweet;

let draft = DraftTweet::new("This is an example status!");

As-is, the draft won't do anything until you call send to post it:

draft.send(&con_token, &access_token).unwrap();

Right now, the options for adding metadata to a post are pretty sparse. See the adaptor functions below to see what metadata can be set. For example, you can use in_reply_to to create a reply-chain like this:

use egg_mode::tweet::DraftTweet;

let draft = DraftTweet::new("I'd like to start a thread here.");
let tweet = draft.send(&con_token, &access_token).unwrap();

let draft = DraftTweet::new("You see, I have a lot of things to say.")
                       .in_reply_to(tweet.response.id);
let tweet = draft.send(&con_token, &access_token).unwrap();

let draft = DraftTweet::new("Thank you for your time.")
                       .in_reply_to(tweet.response.id);
let tweet = draft.send(&con_token, &access_token).unwrap();

Methods

impl<'a> DraftTweet<'a>
[src]

Creates a new DraftTweet with the given status text.

Marks this draft tweet as replying to the given status ID.

Note that this will only properly take effect if the user who posted the given status is @mentioned in the status text, or if the given status was posted by the authenticated user.

Attach a lat/lon coordinate to this tweet, and mark whether a pin should be placed on the exact coordinate when the tweet is displayed.

Send the assembled tweet as the authenticated user.

Trait Implementations

impl<'a> Debug for DraftTweet<'a>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for DraftTweet<'a>

impl<'a> Sync for DraftTweet<'a>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.