pub struct Collection<T> {
pub entity: String,
pub count: u32,
pub items: Vec<T>,
}Expand description
The envelope every list endpoint returns: {"entity": "collection", "count": N, "items": [...]}.
Generic over the item type so one struct serves every resource.
§Examples
for order in &page {
println!("{} is {:?}", order.id, order.status);
}Fields§
§entity: StringAlways "collection" for list responses.
count: u32Number of items in items — not the total matching records.
items: Vec<T>The page of records.
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for Collection<T>
impl<T: Clone> Clone for Collection<T>
Source§impl<T: Debug> Debug for Collection<T>
impl<T: Debug> Debug for Collection<T>
Source§impl<T> Default for Collection<T>
impl<T> Default for Collection<T>
Source§impl<'de, T> Deserialize<'de> for Collection<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Collection<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<T> IntoIterator for Collection<T>
impl<T> IntoIterator for Collection<T>
Source§impl<'a, T> IntoIterator for &'a Collection<T>
impl<'a, T> IntoIterator for &'a Collection<T>
Source§impl<T: PartialEq> PartialEq for Collection<T>
impl<T: PartialEq> PartialEq for Collection<T>
impl<T: PartialEq> StructuralPartialEq for Collection<T>
Auto Trait Implementations§
impl<T> Freeze for Collection<T>
impl<T> RefUnwindSafe for Collection<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Collection<T>
impl<T> Sync for Collection<T>
impl<T> Unpin for Collection<T>
impl<T> UnsafeUnpin for Collection<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Collection<T>where
Vec<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more