PostsMsg

Struct PostsMsg 

Source
pub struct PostsMsg {}
Expand description

Represents the messages to interact with the posts module.

Implementations§

Source§

impl PostsMsg

Source

pub fn create_post( subspace_id: u64, section_id: u32, external_id: Option<&str>, text: &str, entities: Option<Entities>, tags: Vec<&str>, attachments: Vec<AttachmentContent>, author: Addr, conversation_id: Option<u64>, reply_settings: ReplySetting, referenced_posts: Vec<PostReference>, ) -> MsgCreatePost

Creates an instance of MsgCreatePost.

  • subspace_id - Id of the subspace inside which the post must be created.
  • section_id - Id of the section inside which the post must be created.
  • external_id - External id for this post.
  • text - Text of the post.
  • entities - Entities connected to this post.
  • tags - Tags related to this post.
  • attachments - Attachments of the post.
  • author - Author of the post.
  • conversation_id - Id of the original post of the conversation.
  • reply_settings - Reply settings of this post.
  • reference_posts - A list this posts references (either as a reply, repost or quote).
Source

pub fn edit_post( subspace_id: u64, post_id: u64, text: Option<&str>, entities: Option<Entities>, tags: Vec<&str>, editor: Addr, ) -> MsgEditPost

Creates an instance of MsgEditPost.

  • subspace_id - Id of the subspace inside which the post is.
  • post_id - Id of the post to edit.
  • text - New text of the post. It will not change the current post’s text if set this field to None.
  • entities - New entities connected to this post. These will always replace the current post’s entities.
  • editor - Editor of the post.
Source

pub fn delete_post( subspace_id: u64, post_id: u64, signer: Addr, ) -> MsgDeletePost

Creates an instance of MsgDeletePost.

  • subspace_id - Id of the subspace containing the post.
  • post_id - Id of the post to be deleted.
  • signer - User that is deleting the post.
Source

pub fn add_post_attachment( subspace_id: u64, post_id: u64, content: AttachmentContent, editor: Addr, ) -> MsgAddPostAttachment

Creates an instance of MsgAddPostAttachment.

  • subspace_id - Id of the subspace containing the post.
  • post_id - Id of the post from which to remove the attachment.
  • attachment_id - Id of the attachment to be removed.
  • editor - User that is removing the attachment.
Source

pub fn remove_post_attachment( subspace_id: u64, post_id: u64, attachment_id: u32, editor: Addr, ) -> MsgRemovePostAttachment

Creates an instance of MsgRemovePostAttachment.

  • subspace_id - Id of the subspace containing the post.
  • post_id - Id of the post from which to remove the attachment.
  • attachment_id - Id of the attachment to be removed.
  • editor - User that is removing the attachment.
Source

pub fn answer_poll( subspace_id: u64, post_id: u64, poll_id: u32, answers_indexes: Vec<u32>, signer: Addr, ) -> MsgAnswerPoll

Creates an instance of MsgAnswerPoll.

  • subspace_id - Id of the subspace containing the post.
  • post_id - Id of the post that contains the poll to be answered.
  • poll_id - Id of the poll to be answered.
  • answers_indexes - Indexes of the answer inside the ProvidedAnswers array.
  • signer - Address of the user answering the poll.
Source

pub fn move_post( subspace_id: u64, post_id: u64, target_subspace_id: u64, target_section_id: u32, owner: Addr, ) -> MsgMovePost

Creates an instance of MsgMovePost.

  • subspace_id - Id of the subspace where the post is currently located.
  • post_id - Id of the post to be moved.
  • target_subspace_id - Id of the target subspace to which the post will be moved.
  • target_section_id - Id of the target section to which the post will be moved.
  • owner - Address of the post owner.
Source

pub fn request_post_owner_transfer( subspace_id: u64, post_id: u64, receiver: Addr, sender: Addr, ) -> MsgRequestPostOwnerTransfer

Creates an instance of MsgRequestPostOwnerTransfer.

  • subspace_id - Id of the subspace that holds the post which ownership should be transferred.
  • post_id - Id of the post which will be transferred.
  • receiver - Address of the post ownership receiver.
  • sender - Address of the sender who is creating a transfer request.
Source

pub fn cancel_post_owner_transfer_request( subspace_id: u64, post_id: u64, sender: Addr, ) -> MsgCancelPostOwnerTransferRequest

Creates an instance of MsgCancelPostOwnerTransferRequest.

  • subspace_id - Id of the subspace that holds the post for which the request should be canceled.
  • post_id - Id of the post for which the request will be cancelled.
  • sender - Address of the transfer request sender.
Source

pub fn accept_post_owner_transfer_request( subspace_id: u64, post_id: u64, receiver: Addr, ) -> MsgAcceptPostOwnerTransferRequest

Creates an instance of MsgAcceptPostOwnerTransferRequest.

  • subspace_id - Id of the subspace holding the post for which the request will be accepted.
  • post_id - Id of the post for which the request will be accepted.
  • receiver - Address of the request receiver.
Source

pub fn refuse_post_owner_transfer_request( subspace_id: u64, post_id: u64, receiver: Addr, ) -> MsgRefusePostOwnerTransferRequest

Creates an instance of MsgRefusePostOwnerTransferRequest.

  • subspace_id - Id of the subspace holding the post for which the request will be refused.
  • post_id - Id of the post for which the request will be refused.
  • receiver - Address of the request receiver.

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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, 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> Same for T

Source§

type Output = T

Should always be Self
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.