pub enum OcsStatus {
Ok,
Failure,
}Expand description
Verdict an OCS envelope’s meta block carries.
Nextcloud reports the verdict twice: as meta.status ("ok"/"failure")
and as meta.statuscode. The numeric code is the authoritative one, since
it distinguishes causes (997 app not installed, 998 not allowed, 999
invalid) that the two-valued status cannot express.
Variants§
Implementations§
Source§impl OcsStatus
impl OcsStatus
Sourcepub const fn from_statuscode(code: u16) -> Self
pub const fn from_statuscode(code: u16) -> Self
Maps an OCS statuscode to its verdict.
100 and 200 mean success; every other code is a failure.
Sourcepub fn from_status_text(value: &str) -> Option<Self>
pub fn from_status_text(value: &str) -> Option<Self>
Parses the meta.status text, matched case-insensitively.
An unrecognised value yields None rather than a guessed verdict, so a
renamed status surfaces as a decode failure instead of a wrong answer.
Sourcepub const fn is_ok(self) -> bool
pub const fn is_ok(self) -> bool
Whether this verdict is OcsStatus::Ok.
Trait Implementations§
impl Copy for OcsStatus
Source§impl<'de> Deserialize<'de> for OcsStatus
impl<'de> Deserialize<'de> for OcsStatus
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OcsStatus
impl StructuralPartialEq for OcsStatus
Auto Trait Implementations§
impl Freeze for OcsStatus
impl RefUnwindSafe for OcsStatus
impl Send for OcsStatus
impl Sync for OcsStatus
impl Unpin for OcsStatus
impl UnsafeUnpin for OcsStatus
impl UnwindSafe for OcsStatus
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