Module egg_mode::user
[−]
[src]
Structs and methods for pulling user information from Twitter.
All the functions in this module eventually return either a TwitterUser struct or the numeric ID of one. The TwitterUser struct itself contains many fields, relating to the user's profile information and a handful of UI settings available to them. See the struct's documention for details.
UserCursor
/UserLoader
and IDCursor
/IDLoader
(and UserSearch
)
The functions that return the *Loader structs all return paginated results, implemented over
the network as the corresponding *Cursor structs. The Loader structs both implement
Iterator
, returning an individual user or ID at a time. This allows them to easily be used
with regular iterator adaptors and looped over:
for user in twitter::user::friends_of("rustlang", &consumer_token, &access_token) .with_page_size(5) .map(|resp| resp.unwrap().response) .take(5) { println!("{} (@{})", user.name, user.screen_name); }
The actual Item returned by the iterator is Result<Response<TwitterUser>, Error>
; rate-limit
information and network errors are passed into the loop as-is.
Structs
IDCursor |
Represents a single-page view into a list of user IDs. |
IDLoader |
Represents a paginated list of user IDs, such as the list of users who follow or are followed by a specific user. |
TwitterUser |
Represents a Twitter user. |
UserCursor |
Represents a single-page view into a list of users. |
UserLoader |
Represents a paginated list of users, such as the list of users who follow or are followed by a specific user. |
UserSearch |
Represents an active user search. |
Functions
blocks |
Lookup the users that have been blocked by the authenticated user. |
blocks_ids |
Lookup the users that have been blocked by the authenticated user, but only return their user IDs. |
followers_ids |
Lookup the users that follow a given account, but only return their user IDs. |
followers_of |
Lookup the users that follow a given account. |
friends_ids |
Lookup the users a given account follows, also called their "friends" within the API, but only return their user IDs. |
friends_of |
Lookup the users a given account follows, also called their "friends" within the API. |
lookup |
Lookup a set of Twitter users by both ID and screen name, as applicable. |
lookup_ids |
Lookup a set of Twitter users by their numerical ID. |
lookup_names |
Lookup a set of Twitter users by their screen name. |
search |
Lookup users based on the given search term. |
show |
Lookup user information for a single user. |