pub struct Meta { /* private fields */ }Expand description
The meta block of an OCS envelope: the verdict plus pagination hints.
Every field is held as a string because that is what Nextcloud documents
(statuscode, totalitems and itemsperpage are declared as strings) —
yet the server sends bare numbers for several of them, and an empty string
where a count does not apply. Deserialisation accepts both forms and
normalises to text; Meta::code parses the numeric verdict on demand.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn statuscode(&self) -> &str
pub fn statuscode(&self) -> &str
statuscode as sent, usually "100", "200" or a failure code.
Sourcepub fn totalitems(&self) -> &str
pub fn totalitems(&self) -> &str
Total number of items across all pages, when the endpoint paginates.
Sourcepub fn itemsperpage(&self) -> &str
pub fn itemsperpage(&self) -> &str
Items per page, when the endpoint paginates.
Sourcepub fn code(&self) -> Option<u16>
pub fn code(&self) -> Option<u16>
statuscode parsed as a number, None when absent or not a number.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Meta
impl<'de> Deserialize<'de> for Meta
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
impl Eq for Meta
impl StructuralPartialEq for Meta
Auto Trait Implementations§
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl Send for Meta
impl Sync for Meta
impl Unpin for Meta
impl UnsafeUnpin for Meta
impl UnwindSafe for Meta
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