pub struct Listing<T: Source, Q = ()> { /* private fields */ }Expand description
A path parameter naming a field filters too, so a child is listed only under its own parent.
Q reads the query’s other parameters, as crate::Query does; () reads none.
Implementations§
Source§impl<T: Source, Q> Listing<T, Q>
impl<T: Source, Q> Listing<T, Q>
Sourcepub fn parameters(&self) -> Option<&Q>
pub fn parameters(&self) -> Option<&Q>
None when a value was refused: the page then lists nothing and names the refusal.
pub fn where_(self, condition: Condition<T::Base>) -> Self
pub fn query(&self) -> Result<Query<T>>
Sourcepub async fn page(self, read: &Read) -> Result<Listed<T>>
pub async fn page(self, read: &Read) -> Result<Listed<T>>
A parent beyond the read’s reach is not found: an empty list would say it exists. A
filter in error lists nothing, so no one reads an unfiltered list as a filtered one; a
JSON caller or route gets the errors as a 422, as Self::query answers.
Trait Implementations§
Auto Trait Implementations§
impl<T, Q> Forget for Listing<T, Q>
impl<T, Q> Freeze for Listing<T, Q>
impl<T, Q> RefUnwindSafe for Listing<T, Q>
impl<T, Q> Send for Listing<T, Q>
impl<T, Q> Sync for Listing<T, Q>
impl<T, Q> Unpin for Listing<T, Q>
impl<T, Q> UnsafeUnpin for Listing<T, Q>
impl<T, Q> UnwindSafe for Listing<T, Q>
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