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();
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.
Formats the value using the given formatter. Read more
🔬 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
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 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
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Get the TypeId
of this object.