#[non_exhaustive]pub struct BlockUserRequest<'a> {
pub target_user_id: Cow<'a, UserIdRef>,
pub source_context: Option<SourceContext>,
pub reason: Option<Reason>,
}
Available on crate feature
helix
only.Expand description
Query Parameters for Block User
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.target_user_id: Cow<'a, UserIdRef>
User ID of the follower
source_context: Option<SourceContext>
Source context for blocking the user. Valid values: “chat”, “whisper”.
reason: Option<Reason>
Reason for blocking the user. Valid values: “spam”, “harassment”, or “other”.
Implementations§
Source§impl<'a> BlockUserRequest<'a>
impl<'a> BlockUserRequest<'a>
Sourcepub fn builder() -> BlockUserRequestBuilder<'a, ((), (), ())>
pub fn builder() -> BlockUserRequestBuilder<'a, ((), (), ())>
Create a builder for building BlockUserRequest
.
On the builder, call .target_user_id(...)
, .source_context(...)
(optional), .reason(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of BlockUserRequest
.
Source§impl<'a> BlockUserRequest<'a>
impl<'a> BlockUserRequest<'a>
Sourcepub fn block_user(target_user_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
pub fn block_user(target_user_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
Block a user
Sourcepub fn source_context(self, source_context: impl Into<SourceContext>) -> Self
pub fn source_context(self, source_context: impl Into<SourceContext>) -> Self
Set the source_context for this block.
Trait Implementations§
Source§impl<'a> Clone for BlockUserRequest<'a>
impl<'a> Clone for BlockUserRequest<'a>
Source§fn clone(&self) -> BlockUserRequest<'a>
fn clone(&self) -> BlockUserRequest<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for BlockUserRequest<'a>
impl<'a> Debug for BlockUserRequest<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for BlockUserRequest<'a>
impl<'de: 'a, 'a> Deserialize<'de> for BlockUserRequest<'a>
Source§fn 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
Source§impl<'a> PartialEq for BlockUserRequest<'a>
impl<'a> PartialEq for BlockUserRequest<'a>
Source§impl Request for BlockUserRequest<'_>
impl Request for BlockUserRequest<'_>
Source§const OPT_SCOPE: &'static [Scope]
const OPT_SCOPE: &'static [Scope]
Available on crate feature
twitch_oauth2
only.Optional scopes needed by this endpoint
Source§const PATH: &'static str = "users/blocks"
const PATH: &'static str = "users/blocks"
The path to the endpoint relative to the helix root. eg.
channels
for Get Channel InformationSource§const SCOPE: Validator
const SCOPE: Validator
Available on crate feature
twitch_oauth2
only.Scopes needed for this endpoint
Source§fn get_uri(&self) -> Result<Uri, InvalidUri>
fn get_uri(&self) -> Result<Uri, InvalidUri>
Returns full URI for the request, including query parameters.
Source§fn get_bare_uri() -> Result<Uri, InvalidUri>
fn get_bare_uri() -> Result<Uri, InvalidUri>
Returns bare URI for the request, NOT including query parameters.
Source§impl RequestPut for BlockUserRequest<'_>
impl RequestPut for BlockUserRequest<'_>
Source§fn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode,
) -> Result<Response<Self, Self::Response>, HelixRequestPutError>where
Self: Sized,
fn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode,
) -> Result<Response<Self, Self::Response>, HelixRequestPutError>where
Self: Sized,
Parse a response string into the response.
Source§fn create_request(
&self,
body: Self::Body,
token: &str,
client_id: &str,
) -> Result<Request<Bytes>, CreateRequestError>
fn create_request( &self, body: Self::Body, token: &str, client_id: &str, ) -> Result<Request<Bytes>, CreateRequestError>
Create a
http::Request
from this Request
in your clientSource§impl<'a> Serialize for BlockUserRequest<'a>
impl<'a> Serialize for BlockUserRequest<'a>
impl<'a> Eq for BlockUserRequest<'a>
impl<'a> StructuralPartialEq for BlockUserRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for BlockUserRequest<'a>
impl<'a> RefUnwindSafe for BlockUserRequest<'a>
impl<'a> Send for BlockUserRequest<'a>
impl<'a> Sync for BlockUserRequest<'a>
impl<'a> Unpin for BlockUserRequest<'a>
impl<'a> UnwindSafe for BlockUserRequest<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more