Struct mastodon_async::requests::UpdateCredsRequest
source · pub struct UpdateCredsRequest { /* private fields */ }
Expand description
Data structure for the MastodonClient::update_credentials method Builder to pass to the Mastodon::update_credentials method
// Example
use mastodon_async::{prelude::*, entities::visibility::Visibility, UpdateCredsRequest};
let data = Data::default();
let client = Mastodon::from(data);
let mut builder = UpdateCredsRequest::new();
builder.privacy(Visibility::Unlisted);
tokio_test::block_on(async {
let result = client.update_credentials(&mut builder).await.unwrap();
});
Implementations§
source§impl UpdateCredsRequest
impl UpdateCredsRequest
sourcepub fn new() -> UpdateCredsRequest
pub fn new() -> UpdateCredsRequest
Create a new UpdateCredsRequest
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
sourcepub fn display_name<D: Display>(&mut self, name: D) -> &mut Self
pub fn display_name<D: Display>(&mut self, name: D) -> &mut Self
Set the new display_name value
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.display_name("my new display name");
sourcepub fn note<D: Display>(&mut self, note: D) -> &mut Self
pub fn note<D: Display>(&mut self, note: D) -> &mut Self
Set the new note value
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.note("my new note");
sourcepub fn avatar<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
pub fn avatar<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
Set the new avatar value
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.avatar("/path/to/my/new/avatar");
sourcepub fn header<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
pub fn header<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
Set the new header value
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.header("/path/to/my/new/header");
sourcepub fn privacy(&mut self, privacy: Visibility) -> &mut Self
pub fn privacy(&mut self, privacy: Visibility) -> &mut Self
Set the new privacy value
// Example
use mastodon_async::{entities::visibility::Visibility, UpdateCredsRequest};
let mut builder = UpdateCredsRequest::new();
builder.privacy(Visibility::Public);
sourcepub fn sensitive(&mut self, sensitive: bool) -> &mut Self
pub fn sensitive(&mut self, sensitive: bool) -> &mut Self
Set the new sensitive value
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.sensitive(true);
sourcepub fn field_attribute(&mut self, name: &str, value: &str) -> &mut Self
pub fn field_attribute(&mut self, name: &str, value: &str) -> &mut Self
Add a metadata field
// Example
use mastodon_async::UpdateCredsRequest;
let mut builder = UpdateCredsRequest::new();
builder.field_attribute("some key", "some value");
Trait Implementations§
source§impl Clone for UpdateCredsRequest
impl Clone for UpdateCredsRequest
source§fn clone(&self) -> UpdateCredsRequest
fn clone(&self) -> UpdateCredsRequest
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 Debug for UpdateCredsRequest
impl Debug for UpdateCredsRequest
source§impl Default for UpdateCredsRequest
impl Default for UpdateCredsRequest
source§fn default() -> UpdateCredsRequest
fn default() -> UpdateCredsRequest
Returns the “default value” for a type. Read more
source§impl PartialEq for UpdateCredsRequest
impl PartialEq for UpdateCredsRequest
source§fn eq(&self, other: &UpdateCredsRequest) -> bool
fn eq(&self, other: &UpdateCredsRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for UpdateCredsRequest
impl StructuralPartialEq for UpdateCredsRequest
Auto Trait Implementations§
impl RefUnwindSafe for UpdateCredsRequest
impl Send for UpdateCredsRequest
impl Sync for UpdateCredsRequest
impl Unpin for UpdateCredsRequest
impl UnwindSafe for UpdateCredsRequest
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.