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 CONFLICT: StatusCode
pub const CONFLICT: StatusCode
The pull consumer batch has been terminated by the server
This status code is used by the NATS Server for multiple unrelated
conditions, which can only be told apart via
ServerMessage::status_description. Known descriptions include
Batch Completed, Server Shutdown, Leadership Change,
Consumer Deleted, Consumer is push based,
Exceeded MaxRequestBatch of %d, Exceeded MaxRequestExpires of %v,
Exceeded MaxRequestMaxBytes of %v, Exceeded MaxWaiting and
Message Size Exceeds MaxBytes.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more