SubmitPostDataBuilder

Struct SubmitPostDataBuilder 

Source
pub struct SubmitPostDataBuilder {
    pub public_key: Option<String>,
    pub parent_post_hash_hex: Option<String>,
    pub body: Option<String>,
    pub image_urls: Option<Vec<String>>,
    pub video_urls: Option<Vec<String>>,
    pub fee_rate: Option<u64>,
    pub is_hidden: Option<bool>,
    pub extra_data: Option<HashMap<String, String>>,
}
Expand description

Builder for building a submit post data

Fields§

§public_key: Option<String>

Public key of the user making a new post, editing a post, or making a comment

§parent_post_hash_hex: Option<String>

Only used if making a comment. The post hash hex of the post your commenting on.

§body: Option<String>

The body of your post

§image_urls: Option<Vec<String>>

Any and all images for the post

§video_urls: Option<Vec<String>>

Any and all videos for the post

§fee_rate: Option<u64>

Min fee rate nanos per kb, defaults to 1250

§is_hidden: Option<bool>

Used to “delete” a post, defaults to false

§extra_data: Option<HashMap<String, String>>

An optional map of any meta data for the post

Implementations§

Source§

impl SubmitPostDataBuilder

Source

pub fn new() -> Self

Source

pub fn public_key(self, public_key: String) -> Self

Public key of the user making a new post, editing a post, or making a comment

Source

pub fn parent_post_hash_hex(self, post_hash_hex: String) -> Self

Only used if making a comment. The post hash hex of the post your commenting on.

Source

pub fn body(self, body: String) -> Self

The body of your post

Source

pub fn image_urls(self, image_urls: Vec<String>) -> Self

Any and all images for the post

Source

pub fn video_urls(self, video_urls: Vec<String>) -> Self

Any and all videos for the post

Source

pub fn fee_rate(self, fee_rate: u64) -> Self

Min fee rate nanos per kb, defaults to 1250

Source

pub fn is_hidden(self, is_hidden: bool) -> Self

Used to “delete” a post, defaults to false

Source

pub fn extra_data(self, extra_data: HashMap<String, String>) -> Self

An optional map of any meta data for the post

Source

pub fn build(self) -> Result<SubmitPostData, DesoError>

Builds the SubmitPostData

Trait Implementations§

Source§

impl Debug for SubmitPostDataBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SubmitPostDataBuilder

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SubmitPostDataBuilder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,