PostsQuerier

Struct PostsQuerier 

Source
pub struct PostsQuerier<'a> { /* private fields */ }
Expand description

Querier allows to query data from the Desmos x/posts module.

Implementations§

Source§

impl<'a> PostsQuerier<'a>

Source

pub fn new(querier: &'a QuerierWrapper<'a, Empty>) -> Self

Creates a new instance of PostsQuerier.

§Example
use cosmwasm_std::{DepsMut, MessageInfo};
use desmos_bindings::posts::querier::PostsQuerier;

pub fn contract_action(deps: DepsMut, _: MessageInfo) {
    let querier = PostsQuerier::new(&deps.querier);
}
Source

pub fn query_subspace_posts( &self, subspace_id: u64, pagination: Option<PageRequest>, ) -> StdResult<QuerySubspacePostsResponse>

Queries posts created inside a subspace.

  • subspace_id - Subspace to query the posts for.
  • pagination - Optional pagination configs.
Source

pub fn iterate_subspace_posts( &self, subspace_id: u64, page_size: u64, ) -> PageIterator<'_, Post, Binary>

Gives an iterator to scan over the posts created inside a subspace.

  • subspace_id - Subspace to query the posts for.
  • page_size - Size of the page requested to the chain.
Source

pub fn query_section_posts( &self, subspace_id: u64, section_id: u32, pagination: Option<PageRequest>, ) -> StdResult<QuerySectionPostsResponse>

Queries all the posts inside a give section.

  • subspace_id - Subspace to query the posts for.
  • section_id - Section to query the post for.
  • pagination - Optional pagination configs.
Source

pub fn iterate_section_posts( &self, subspace_id: u64, section_id: u32, page_size: u64, ) -> PageIterator<'_, Post, Binary>

Gives an iterator to scan over the posts created inside a give section.

  • subspace_id - Subspace to query the posts for.
  • section_id - Section to query the post for.
  • page_size - Size of the page requested to the chain.
Source

pub fn query_post( &self, subspace_id: u64, post_id: u64, ) -> StdResult<QueryPostResponse>

Queries a single post inside a given subspace.

  • subspace_id - Id of the subspace where the post is stored.
  • post_id - Id of the post to query for.
Source

pub fn query_post_attachments( &self, subspace_id: u64, post_id: u64, pagination: Option<PageRequest>, ) -> StdResult<QueryPostAttachmentsResponse>

Queries the attachments of the post having the given post_id.

  • subspace_id - Id of the subspace where the post is stored.
  • post_id - Id of the post to query the attachments for.
  • pagination - Optional pagination configs.
Source

pub fn iterate_post_attachments( &self, subspace_id: u64, post_id: u64, page_size: u64, ) -> PageIterator<'_, Attachment, Binary>

Gives an iterator to scan over the attachments of the post having the given post_id.

  • subspace_id - Id of the subspace where the post is stored.
  • post_id - Id of the post to query the attachments for.
  • page_size - Size of the page requested to the chain.
Source

pub fn query_poll_answers( &self, subspace_id: u64, post_id: u64, poll_id: u32, user: Option<Addr>, pagination: Option<PageRequest>, ) -> StdResult<QueryPollAnswersResponse>

Queries the answers for the poll having the given post_id.

  • subspace_id - Id of the subspace where the post is stored.
  • poll_id - Id of the post that holds the poll.
  • user - Optional address of the user to query the responses for.
  • pagination - Optional pagination configs.
Source

pub fn iterate_poll_answers( &self, subspace_id: u64, post_id: u64, poll_id: u32, user: Option<Addr>, page_size: u64, ) -> PageIterator<'_, UserAnswer, Binary>

Gives an iterator to scan over the answers for the poll having the given post_id.

  • subspace_id - Id of the subspace where the post is stored.
  • poll_id - Id of the post that holds the poll.
  • user - Optional address of the user to query the responses for.
  • page_size - Size of the page requested to the chain.
Source

pub fn query_incoming_post_transfer_requests( &self, subspace_id: u64, receiver: Option<Addr>, pagination: Option<PageRequest>, ) -> StdResult<QueryIncomingPostOwnerTransferRequestsResponse>

Queries the incoming post transfer requests having the given subspace_id.

  • subspace_id - Id of the subspace where the requests are stored.
  • receiver - Optional the address of the user to which query the incoming requests for.
  • pagination - Optional pagination for the request.
Source

pub fn iterate_incoming_post_transfer_requests( &self, subspace_id: u64, receiver: Option<Addr>, page_size: u64, ) -> PageIterator<'_, PostOwnerTransferRequest, Binary>

Gives an iterator to scan over the incoming post transfer requests having the given subspace_id.

  • subspace_id - Id of the subspace where the requests are stored.
  • receiver - Optional the address of the user to which query the incoming requests for.
  • page_size - Size of the page requested to the chain.

Auto Trait Implementations§

§

impl<'a> Freeze for PostsQuerier<'a>

§

impl<'a> !RefUnwindSafe for PostsQuerier<'a>

§

impl<'a> !Send for PostsQuerier<'a>

§

impl<'a> !Sync for PostsQuerier<'a>

§

impl<'a> Unpin for PostsQuerier<'a>

§

impl<'a> !UnwindSafe for PostsQuerier<'a>

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.