Struct pushover_rs::AttachmentMessageBuilder
source · [−]pub struct AttachmentMessageBuilder { /* private fields */ }Expand description
Helps build a correct Pushover request, with attachment.
Implementations
sourceimpl AttachmentMessageBuilder
impl AttachmentMessageBuilder
sourcepub fn new(user_key: &str, application_token: &str, message: &str) -> Self
pub fn new(user_key: &str, application_token: &str, message: &str) -> Self
Creates a new MessageBuilder instance with the required minimal informations (User key, App token & Message)
sourcepub fn modify_message(self, message: &str) -> AttachmentMessageBuilder
pub fn modify_message(self, message: &str) -> AttachmentMessageBuilder
Modifies the existing message.
sourcepub fn add_title(self, title: &str) -> AttachmentMessageBuilder
pub fn add_title(self, title: &str) -> AttachmentMessageBuilder
Adds a title to your message
sourcepub fn remove_title(self) -> AttachmentMessageBuilder
pub fn remove_title(self) -> AttachmentMessageBuilder
Removes the title. The title will be defaulted to your application name.
sourcepub fn add_url(
self,
url: &str,
url_title: Option<&str>
) -> AttachmentMessageBuilder
pub fn add_url(
self,
url: &str,
url_title: Option<&str>
) -> AttachmentMessageBuilder
Adds an url (and optionally, an url title) to send along with your message.
If set, the URL title will be shown, otherwise the URL will be shown.
sourcepub fn remove_url(self) -> AttachmentMessageBuilder
pub fn remove_url(self) -> AttachmentMessageBuilder
Removes both the url and url title from your message
sourcepub fn set_priority(self, priority: i8) -> AttachmentMessageBuilder
pub fn set_priority(self, priority: i8) -> AttachmentMessageBuilder
Send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user’s quiet hours, or 2 to also require confirmation from the user.
sourcepub fn remove_priority(self) -> AttachmentMessageBuilder
pub fn remove_priority(self) -> AttachmentMessageBuilder
Resets the priority to default (0, normal)
sourcepub fn set_sound(self, sound: PushoverSound) -> AttachmentMessageBuilder
pub fn set_sound(self, sound: PushoverSound) -> AttachmentMessageBuilder
Sets the sound to be used to notify the user.
See this list of available sounds: https://pushover.net/api#sounds
sourcepub fn remove_sound(self) -> AttachmentMessageBuilder
pub fn remove_sound(self) -> AttachmentMessageBuilder
Removes the custom sound and reverts to the default sound.
sourcepub fn set_timestamp(self, unix_timestamp: u64) -> AttachmentMessageBuilder
pub fn set_timestamp(self, unix_timestamp: u64) -> AttachmentMessageBuilder
Sets an Unix timestamp of your message’s date and time to display to the user, rather than the time your message is received by our API
sourcepub fn remove_timestamp(self) -> AttachmentMessageBuilder
pub fn remove_timestamp(self) -> AttachmentMessageBuilder
Resets the custom unix timestamp
sourcepub fn add_device(self, device_name: &str) -> AttachmentMessageBuilder
pub fn add_device(self, device_name: &str) -> AttachmentMessageBuilder
Add a device name to send the notification to.
Ignores if the device name is already in the list.
sourcepub fn set_devices(self, device_names: Vec<&str>) -> AttachmentMessageBuilder
pub fn set_devices(self, device_names: Vec<&str>) -> AttachmentMessageBuilder
Overrides the current devices list with device_names
sourcepub fn merge_devices(self, device_names: Vec<&str>) -> AttachmentMessageBuilder
pub fn merge_devices(self, device_names: Vec<&str>) -> AttachmentMessageBuilder
Merges the current devices list with device_names, duplicates are eliminated
pub fn clear_devices_list(self) -> AttachmentMessageBuilder
sourcepub fn set_attachment(self, attachment_path: String) -> AttachmentMessageBuilder
pub fn set_attachment(self, attachment_path: String) -> AttachmentMessageBuilder
Add attachment to the message.
Attachments cannot be larger than 2.5MB.
Adding an attachment will make the API call blocking.
Auto Trait Implementations
impl RefUnwindSafe for AttachmentMessageBuilder
impl Send for AttachmentMessageBuilder
impl Sync for AttachmentMessageBuilder
impl Unpin for AttachmentMessageBuilder
impl UnwindSafe for AttachmentMessageBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more