Struct twitch_api::helix::whispers::SendWhisperBody
source · [−]Available on crate feature
helix
only.Expand description
Body Parameters for Send Whisper
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.message: Cow<'a, str>
The whisper message to send. The message must not be empty.
The maximum message lengths are:
500 characters if the user you’re sending the message to hasn’t whispered you before. 10,000 characters if the user you’re sending the message to has whispered you before.
Messages that exceed the maximum length are truncated.
Implementations
sourceimpl<'a> SendWhisperBody<'a>
impl<'a> SendWhisperBody<'a>
sourcepub fn new(message: impl Into<Cow<'a, str>>) -> Self
pub fn new(message: impl Into<Cow<'a, str>>) -> Self
Create a new message
Examples found in repository?
More examples
src/helix/client/client_ext.rs (line 881)
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
pub async fn send_whisper<'b, T>(
&'a self,
from: impl types::IntoCow<'b, types::UserIdRef> + 'b,
to: impl types::IntoCow<'b, types::UserIdRef> + 'b,
message: impl Into<&'b str>,
token: &T,
) -> Result<helix::whispers::SendWhisperResponse, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
Ok(self
.req_post(
helix::whispers::SendWhisperRequest::new(from, to),
helix::whispers::SendWhisperBody::new(message.into()),
token,
)
.await?
.data)
}
Trait Implementations
sourceimpl<'a> Clone for SendWhisperBody<'a>
impl<'a> Clone for SendWhisperBody<'a>
sourcefn clone(&self) -> SendWhisperBody<'a>
fn clone(&self) -> SendWhisperBody<'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 SendWhisperBody<'a>
impl<'a> Debug for SendWhisperBody<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for SendWhisperBody<'a>
impl<'de: 'a, 'a> Deserialize<'de> for SendWhisperBody<'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> From<&'a str> for SendWhisperBody<'a>
impl<'a> From<&'a str> for SendWhisperBody<'a>
sourceimpl<'a> PartialEq<SendWhisperBody<'a>> for SendWhisperBody<'a>
impl<'a> PartialEq<SendWhisperBody<'a>> for SendWhisperBody<'a>
sourcefn eq(&self, other: &SendWhisperBody<'a>) -> bool
fn eq(&self, other: &SendWhisperBody<'a>) -> bool
sourceimpl<'a> Serialize for SendWhisperBody<'a>
impl<'a> Serialize for SendWhisperBody<'a>
impl<'a> Eq for SendWhisperBody<'a>
impl<'a> StructuralEq for SendWhisperBody<'a>
impl<'a> StructuralPartialEq for SendWhisperBody<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for SendWhisperBody<'a>
impl<'a> Send for SendWhisperBody<'a>
impl<'a> Sync for SendWhisperBody<'a>
impl<'a> Unpin for SendWhisperBody<'a>
impl<'a> UnwindSafe for SendWhisperBody<'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.sourceimpl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
impl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
sourcefn try_to_body(&self) -> Result<Bytes, BodyError>
fn try_to_body(&self) -> Result<Bytes, BodyError>
Available on crate feature
helix
only.Create the body