Module jupiter::response

source ·
Expand description

Represents a memory backed RESP response.

We use an internal buffer here so that we can build the complete response in one go without blocking and then push the whole thing into the network with a single sys-call.

Therefore we pre-allocate a buffer of 8k and grow this if needed. Note that so far, no intermediate write will happen and the whole response is buffered in memory. As we expect responses to be small, this is a good approach - however, when trying to send gigabytes, this isn’t probably the way to go.

Example


let mut response = Response::new();
response.ok()?;
assert_eq!(response.complete_string()?, "+OK\r\n");

Structs

  • Represents a RESP response being built.

Enums

  • Enumerates the possible errors when creating a response.

Statics

  • Represents a separator used when outputting management data.

Type Definitions

  • Represents the result type for all output operations.