Struct mastodon_async::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::*, status_builder::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::{status_builder::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<UpdateCredsRequest> for UpdateCredsRequest
impl PartialEq<UpdateCredsRequest> 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 ==.