pub struct StatusCode(/* private fields */);Expand description
A NATS status code
Constants are provided for known and accurately status codes within the NATS Server.
Values are guaranteed to be in range 100..1000.
Implementations§
Source§impl StatusCode
impl StatusCode
Sourcepub const IDLE_HEARTBEAT: StatusCode
pub const IDLE_HEARTBEAT: StatusCode
The Jetstream consumer hearthbeat timeout has been reached with no new messages to deliver
See ADR-9.
Sourcepub const OK: StatusCode
pub const OK: StatusCode
The request has successfully been sent
Sourcepub const NOT_FOUND: StatusCode
pub const NOT_FOUND: StatusCode
The requested Jetstream resource doesn’t exist
Sourcepub const TIMEOUT: StatusCode
pub const TIMEOUT: StatusCode
The pull consumer batch reached the timeout
Sourcepub const NO_RESPONDERS: StatusCode
pub const NO_RESPONDERS: StatusCode
The request was sent to a subject that does not appear to have any subscribers listening
Sourcepub fn from_ascii_bytes(buf: &[u8]) -> Result<Self, StatusCodeError>
pub fn from_ascii_bytes(buf: &[u8]) -> Result<Self, StatusCodeError>
Decodes a status code from a slice of ASCII characters.
The ASCII representation is expected to be in the form of "NNN", where N is a numeric
digit.
§Errors
It returns an error if the slice of bytes does not contain a valid status code.
Trait Implementations§
Source§impl Clone for StatusCode
impl Clone for StatusCode
Source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatusCode
impl Debug for StatusCode
Source§impl<'de> Deserialize<'de> for StatusCode
impl<'de> Deserialize<'de> for StatusCode
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
Source§impl Display for StatusCode
impl Display for StatusCode
Source§impl From<StatusCode> for u16
impl From<StatusCode> for u16
Source§fn from(value: StatusCode) -> Self
fn from(value: StatusCode) -> Self
Converts to this type from the input type.
Source§impl FromStr for StatusCode
impl FromStr for StatusCode
Source§impl Ord for StatusCode
impl Ord for StatusCode
Source§fn cmp(&self, other: &StatusCode) -> Ordering
fn cmp(&self, other: &StatusCode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
Source§impl PartialOrd for StatusCode
impl PartialOrd for StatusCode
Source§impl Serialize for StatusCode
impl Serialize for StatusCode
Source§impl TryFrom<u16> for StatusCode
impl TryFrom<u16> for StatusCode
impl Copy for StatusCode
impl Eq for StatusCode
impl StructuralPartialEq for StatusCode
Auto Trait Implementations§
impl Freeze for StatusCode
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnwindSafe for StatusCode
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