Struct twitch_api::helix::search::SearchChannelsRequest
source · [−]#[non_exhaustive]pub struct SearchChannelsRequest<'a> {
pub query: Cow<'a, str>,
pub after: Option<Cow<'a, CursorRef>>,
pub first: Option<usize>,
pub live_only: Option<bool>,
}
Available on crate feature
helix
only.Expand description
Query Parameters for Search Channels
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.query: Cow<'a, str>
URL encoded search query
after: Option<Cow<'a, CursorRef>>
Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. The cursor value specified here is from the pagination response field of a prior query.
first: Option<usize>
Maximum number of objects to return. Maximum: 100 Default: 20
live_only: Option<bool>
Filter results for live streams only. Default: false
Implementations
sourceimpl<'a> SearchChannelsRequest<'a>
impl<'a> SearchChannelsRequest<'a>
sourcepub fn builder() -> SearchChannelsRequestBuilder<'a, ((), (), (), ())>
pub fn builder() -> SearchChannelsRequestBuilder<'a, ((), (), (), ())>
Create a builder for building SearchChannelsRequest
.
On the builder, call .query(...)
, .after(...)
(optional), .first(...)
(optional), .live_only(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of SearchChannelsRequest
.
sourceimpl<'a> SearchChannelsRequest<'a>
impl<'a> SearchChannelsRequest<'a>
sourcepub fn query(query: impl Into<Cow<'a, str>>) -> Self
pub fn query(query: impl Into<Cow<'a, str>>) -> Self
Search channels with the following query.
Examples found in repository?
src/helix/client/client_ext.rs (line 176)
165 166 167 168 169 170 171 172 173 174 175 176 177 178
pub fn search_channels<T>(
&'a self,
query: impl Into<&'a str>,
live_only: bool,
token: &'a T,
) -> std::pin::Pin<
Box<dyn futures::Stream<Item = Result<helix::search::Channel, ClientError<'a, C>>> + 'a>,
>
where
T: TwitchToken + Send + Sync + ?Sized,
{
let req = helix::search::SearchChannelsRequest::query(query.into()).live_only(live_only);
make_stream(req, token, self, std::collections::VecDeque::from)
}
sourcepub fn live_only(self, live_only: bool) -> Self
pub fn live_only(self, live_only: bool) -> Self
Get live streams only
Examples found in repository?
src/helix/client/client_ext.rs (line 176)
165 166 167 168 169 170 171 172 173 174 175 176 177 178
pub fn search_channels<T>(
&'a self,
query: impl Into<&'a str>,
live_only: bool,
token: &'a T,
) -> std::pin::Pin<
Box<dyn futures::Stream<Item = Result<helix::search::Channel, ClientError<'a, C>>> + 'a>,
>
where
T: TwitchToken + Send + Sync + ?Sized,
{
let req = helix::search::SearchChannelsRequest::query(query.into()).live_only(live_only);
make_stream(req, token, self, std::collections::VecDeque::from)
}
Trait Implementations
sourceimpl<'a> Clone for SearchChannelsRequest<'a>
impl<'a> Clone for SearchChannelsRequest<'a>
sourcefn clone(&self) -> SearchChannelsRequest<'a>
fn clone(&self) -> SearchChannelsRequest<'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 SearchChannelsRequest<'a>
impl<'a> Debug for SearchChannelsRequest<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for SearchChannelsRequest<'a>
impl<'de: 'a, 'a> Deserialize<'de> for SearchChannelsRequest<'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 Paginated for SearchChannelsRequest<'_>
impl Paginated for SearchChannelsRequest<'_>
sourcefn set_pagination(&mut self, cursor: Option<Cursor>)
fn set_pagination(&mut self, cursor: Option<Cursor>)
Should returns the current pagination cursor. Read more
sourceimpl<'a> PartialEq<SearchChannelsRequest<'a>> for SearchChannelsRequest<'a>
impl<'a> PartialEq<SearchChannelsRequest<'a>> for SearchChannelsRequest<'a>
sourcefn eq(&self, other: &SearchChannelsRequest<'a>) -> bool
fn eq(&self, other: &SearchChannelsRequest<'a>) -> bool
sourceimpl Request for SearchChannelsRequest<'_>
impl Request for SearchChannelsRequest<'_>
sourceconst PATH: &'static str = "search/channels"
const PATH: &'static str = "search/channels"
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
sourceconst OPT_SCOPE: &'static [Scope] = _
const OPT_SCOPE: &'static [Scope] = _
Available on crate feature
twitch_oauth2
only.Optional 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 SearchChannelsRequest<'_>
impl RequestGet for SearchChannelsRequest<'_>
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 SearchChannelsRequest<'a>
impl<'a> Serialize for SearchChannelsRequest<'a>
impl<'a> Eq for SearchChannelsRequest<'a>
impl<'a> StructuralEq for SearchChannelsRequest<'a>
impl<'a> StructuralPartialEq for SearchChannelsRequest<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for SearchChannelsRequest<'a>
impl<'a> Send for SearchChannelsRequest<'a>
impl<'a> Sync for SearchChannelsRequest<'a>
impl<'a> Unpin for SearchChannelsRequest<'a>
impl<'a> UnwindSafe for SearchChannelsRequest<'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.