Struct twitch_api::helix::users::get_users::GetUsersRequest
source · [−]#[non_exhaustive]pub struct GetUsersRequest<'a> {
pub id: Cow<'a, [&'a UserIdRef]>,
pub login: Cow<'a, [&'a UserNameRef]>,
}
Available on crate feature
helix
only.Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: Cow<'a, [&'a UserIdRef]>
User ID. Multiple user IDs can be specified. Limit: 100.
login: Cow<'a, [&'a UserNameRef]>
User login name. Multiple login names can be specified. Limit: 100.
Implementations
sourceimpl<'a> GetUsersRequest<'a>
impl<'a> GetUsersRequest<'a>
sourceimpl<'a> GetUsersRequest<'a>
impl<'a> GetUsersRequest<'a>
sourcepub fn logins(login: impl Into<Cow<'a, [&'a UserNameRef]>>) -> Self
pub fn logins(login: impl Into<Cow<'a, [&'a UserNameRef]>>) -> Self
Get multiple user by their UserName
use twitch_api::helix::users::get_users::GetUsersRequest;
GetUsersRequest::logins(&["twitch".into(), "justintv".into()][..]);
Examples found in repository?
src/helix/client/client_ext.rs (line 24)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
pub async fn get_user_from_login<T>(
&'a self,
login: impl Into<&types::UserNameRef>,
token: &T,
) -> Result<Option<helix::users::User>, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
self.req_get(
helix::users::GetUsersRequest::logins(&[login.into()][..]),
token,
)
.await
.map(|response| response.first())
}
sourcepub fn ids(ids: impl Into<Cow<'a, [&'a UserIdRef]>>) -> Self
pub fn ids(ids: impl Into<Cow<'a, [&'a UserIdRef]>>) -> Self
Get multiple user by their UserId
Examples found in repository?
src/helix/client/client_ext.rs (line 40)
32 33 34 35 36 37 38 39 40 41 42 43
pub async fn get_user_from_id<T>(
&'a self,
id: impl Into<&types::UserIdRef>,
token: &T,
) -> Result<Option<helix::users::User>, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
self.req_get(helix::users::GetUsersRequest::ids(&[id.into()][..]), token)
.await
.map(|response| response.first())
}
sourcepub fn new() -> Self
pub fn new() -> Self
Returns an empty GetUsersRequest
Notes
This is not a valid request, it needs to be filled out with other fields.
Trait Implementations
sourceimpl<'a> Clone for GetUsersRequest<'a>
impl<'a> Clone for GetUsersRequest<'a>
sourcefn clone(&self) -> GetUsersRequest<'a>
fn clone(&self) -> GetUsersRequest<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for GetUsersRequest<'a>
impl<'a> Debug for GetUsersRequest<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for GetUsersRequest<'a>
impl<'de: 'a, 'a> Deserialize<'de> for GetUsersRequest<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a> PartialEq<GetUsersRequest<'a>> for GetUsersRequest<'a>
impl<'a> PartialEq<GetUsersRequest<'a>> for GetUsersRequest<'a>
sourcefn eq(&self, other: &GetUsersRequest<'a>) -> bool
fn eq(&self, other: &GetUsersRequest<'a>) -> bool
sourceimpl Request for GetUsersRequest<'_>
impl Request for GetUsersRequest<'_>
sourceconst OPT_SCOPE: &'static [Scope] = _
const OPT_SCOPE: &'static [Scope] = _
Available on crate feature
twitch_oauth2
only.Optional scopes needed by this endpoint
sourceconst PATH: &'static str = "users"
const PATH: &'static str = "users"
The path to the endpoint relative to the helix root. eg.
channels
for Get Channel Informationsourceconst SCOPE: &'static [Scope] = _
const SCOPE: &'static [Scope] = _
Available on crate feature
twitch_oauth2
only.Scopes needed by this endpoint
sourcefn query(&self) -> Result<String, SerializeError>
fn query(&self) -> Result<String, SerializeError>
Defines layout of the url parameters.
sourcefn get_uri(&self) -> Result<Uri, InvalidUri>
fn get_uri(&self) -> Result<Uri, InvalidUri>
Returns full URI for the request, including query parameters.
sourcefn get_bare_uri() -> Result<Uri, InvalidUri>
fn get_bare_uri() -> Result<Uri, InvalidUri>
Returns bare URI for the request, NOT including query parameters.
sourceimpl RequestGet for GetUsersRequest<'_>
impl RequestGet for GetUsersRequest<'_>
sourcefn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
fn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
Create a
http::Request
from this Request
in your clientsourcefn parse_response<B: Into<Bytes>>(
request: Option<Self>,
uri: &Uri,
response: Response<B>
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
fn parse_response<B: Into<Bytes>>(
request: Option<Self>,
uri: &Uri,
response: Response<B>
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
Parse response. Read more
sourcefn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
fn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
Parse a response string into the response.
sourceimpl<'a> Serialize for GetUsersRequest<'a>
impl<'a> Serialize for GetUsersRequest<'a>
impl<'a> Eq for GetUsersRequest<'a>
impl<'a> StructuralEq for GetUsersRequest<'a>
impl<'a> StructuralPartialEq for GetUsersRequest<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for GetUsersRequest<'a>
impl<'a> Send for GetUsersRequest<'a>
impl<'a> Sync for GetUsersRequest<'a>
impl<'a> Unpin for GetUsersRequest<'a>
impl<'a> UnwindSafe for GetUsersRequest<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.