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

Query results

Implementations§

source§

impl<'a> QueryResults<'a>

source

pub fn was_cached(&self) -> bool

Were these results retreived from a cache?

source

pub fn total_results(&self) -> u32

Gets the total number of results in this query, not just the current page

source

pub fn returned_results(&self) -> u32

Gets the number of results in this page.

source

pub fn preview_url(&self, index: u32) -> Option<String>

Gets the preview URL of the published file at the specified index.

source

pub fn statistic(&self, index: u32, stat_type: UGCStatisticType) -> Option<u64>

Gets a UGC statistic about the published file at the specified index.

source

pub fn content_descriptor(&self, index: u32) -> Vec<UGCContentDescriptorID>

Gets UGCContentDescriptors of the published file at the specified index.

source

pub fn get(&self, index: u32) -> Option<QueryResult>

Gets a result.

Returns None if index was out of bounds.

source

pub fn iter<'b>(&'b self) -> impl Iterator<Item = Option<QueryResult>> + 'b

Returns an iterator that runs over all the fetched results

source

pub fn get_children(&self, index: u32) -> Option<Vec<PublishedFileId>>

Returns the given index’s children as a list of PublishedFileId.

You must call include_children(true) before fetching the query for this to work.

Returns None if the index was out of bounds.

source

pub fn key_value_tags(&self, index: u32) -> u32

Returns the number of key value tags associated with the item at the specified index.

source

pub fn get_key_value_tag( &self, index: u32, kv_tag_index: u32 ) -> Option<(String, String)>

Gets the key value pair of a specified key value tag associated with the item at the specified index.

source

pub fn get_metadata(&self, index: u32) -> Option<Vec<u8>>

Gets the developer-set metadata associated with the item at the specified index.

This is returned as a vector of raw bytes.

Trait Implementations§

source§

impl<'a> Drop for QueryResults<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for QueryResults<'a>

§

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

§

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

§

impl<'a> Unpin for QueryResults<'a>

§

impl<'a> UnwindSafe for QueryResults<'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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.