pub struct NoteBuilder<C> { /* private fields */ }Expand description
Builder for the build_note method.
Implementations§
Source§impl<C> NoteBuilder<C>
impl<C> NoteBuilder<C>
Sourcepub fn as_request(&self) -> &Request
pub fn as_request(&self) -> &Request
Gets the request object for reuse.
Sourcepub fn poll(
&mut self,
choices: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn poll( &mut self, choices: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Creates a poll and sets the choices.
Sourcepub fn poll_multiple(&mut self, multiple: bool) -> &mut Self
pub fn poll_multiple(&mut self, multiple: bool) -> &mut Self
Sets whether to allow multiple votes.
Sourcepub fn poll_expires_at(&mut self, at: DateTime<Utc>) -> &mut Self
pub fn poll_expires_at(&mut self, at: DateTime<Utc>) -> &mut Self
Sets when the vote will expire.
Sourcepub fn poll_expires_after(&mut self, after: Duration) -> &mut Self
pub fn poll_expires_after(&mut self, after: Duration) -> &mut Self
Sets how long the vote will expire after.
Sourcepub fn attach_file(&mut self, file: impl EntityRef<DriveFile>) -> &mut Self
pub fn attach_file(&mut self, file: impl EntityRef<DriveFile>) -> &mut Self
Attaches the specified file to the note.
Sourcepub fn attach_files(
&mut self,
files: impl IntoIterator<Item = impl EntityRef<DriveFile>>,
) -> &mut Self
pub fn attach_files( &mut self, files: impl IntoIterator<Item = impl EntityRef<DriveFile>>, ) -> &mut Self
Adds attachments to the note.
Sourcepub fn visibility(&mut self, visibility: Visibility) -> &mut Self
pub fn visibility(&mut self, visibility: Visibility) -> &mut Self
Sets the visibility of the note.
Sourcepub fn public(&mut self) -> &mut Self
pub fn public(&mut self) -> &mut Self
Sets the note to be visible to everyone.
This is equivalent to .visibility(Visibility::Public).
Sourcepub fn home_only(&mut self) -> &mut Self
pub fn home_only(&mut self) -> &mut Self
Sets the note to be visible only to the home timeline.
This is equivalent to .visibility(Visibility::Home).
Sourcepub fn followers_only(&mut self) -> &mut Self
pub fn followers_only(&mut self) -> &mut Self
Sets the note to be visible only to the followers.
This is equivalent to .visibility(Visibility::Followers).
Sourcepub fn direct(
&mut self,
recipients: impl IntoIterator<Item = impl EntityRef<User>>,
) -> &mut Self
pub fn direct( &mut self, recipients: impl IntoIterator<Item = impl EntityRef<User>>, ) -> &mut Self
Sets the note to be visible only to the specified users.
Sourcepub fn hide_content(&mut self, cw_text: impl Into<String>) -> &mut Self
pub fn hide_content(&mut self, cw_text: impl Into<String>) -> &mut Self
Hides the contents of the note as a content warning with the specified text.
Sourcepub fn via_mobile(&mut self, via_mobile: bool) -> &mut Self
pub fn via_mobile(&mut self, via_mobile: bool) -> &mut Self
Sets whether to show the note as posted from a mobile device.
Sourcepub fn local_only(&mut self, local_only: bool) -> &mut Self
pub fn local_only(&mut self, local_only: bool) -> &mut Self
Sets the note to be visible only to users on the same instance.
Sourcepub fn extract_mentions(&mut self, extract_mentions: bool) -> &mut Self
pub fn extract_mentions(&mut self, extract_mentions: bool) -> &mut Self
Sets whether or not to extract mentions (i.e. @username) from the text of the note.
Mentions are extracted by default, and you would need this method if you want to disable this behavior.
Sets whether or not to extract hashtags (i.e. #tag) from the text of the note.
Hashtags are extracted by default, and you would need this method if you want to disable this behavior.
Sourcepub fn extract_emojis(&mut self, extract_emojis: bool) -> &mut Self
pub fn extract_emojis(&mut self, extract_emojis: bool) -> &mut Self
Sets whether or not to extract emojis (i.e. :emoji:) from the text of the note.
Emojis are extracted by default, and you would need this method if you want to disable this behavior.
Sourcepub fn reply(&mut self, note: impl EntityRef<Note>) -> &mut Self
pub fn reply(&mut self, note: impl EntityRef<Note>) -> &mut Self
Sets the note as a reply to the specified note.