Struct hyper_scripter::error::ExitCode
source · pub struct ExitCode(/* private fields */);
Implementations§
source§impl ExitCode
impl ExitCode
sourcepub fn cmp_and_replace(&mut self, code: ExitCode)
pub fn cmp_and_replace(&mut self, code: ExitCode)
將另一個 ExitCode
和自身比較,若對方較嚴重,則將自身的值變成對方
use hyper_scripter::error::*;
let mut code = EXIT_KNOWN_ERR;
code.cmp_and_replace(EXIT_OK);
assert_eq!(code, EXIT_KNOWN_ERR);
code.cmp_and_replace(EXIT_OTHER_ERR);
assert_eq!(code, EXIT_OTHER_ERR);
pub fn code(&self) -> i32
Trait Implementations§
source§impl PartialEq for ExitCode
impl PartialEq for ExitCode
impl Copy for ExitCode
impl Eq for ExitCode
impl StructuralEq for ExitCode
impl StructuralPartialEq for ExitCode
Auto Trait Implementations§
impl RefUnwindSafe for ExitCode
impl Send for ExitCode
impl Sync for ExitCode
impl Unpin for ExitCode
impl UnwindSafe for ExitCode
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.