pub trait Buffer {
// Required methods
fn as_ngx_buf(&self) -> *const ngx_buf_t;
fn as_ngx_buf_mut(&mut self) -> *mut ngx_buf_t;
// Provided methods
fn as_bytes(&self) -> &[u8] ⓘ { ... }
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn set_last_buf(&mut self, last: bool) { ... }
fn set_last_in_chain(&mut self, last: bool) { ... }
}
Expand description
The Buffer
trait provides methods for working with an nginx buffer (ngx_buf_t
).
See https://nginx.org/en/docs/dev/development_guide.html#buffer
Required Methods§
Sourcefn as_ngx_buf(&self) -> *const ngx_buf_t
fn as_ngx_buf(&self) -> *const ngx_buf_t
Returns a raw pointer to the underlying ngx_buf_t
of the buffer.
Sourcefn as_ngx_buf_mut(&mut self) -> *mut ngx_buf_t
fn as_ngx_buf_mut(&mut self) -> *mut ngx_buf_t
Returns a mutable raw pointer to the underlying ngx_buf_t
of the buffer.
Provided Methods§
Sourcefn set_last_buf(&mut self, last: bool)
fn set_last_buf(&mut self, last: bool)
Sets the last_buf
flag of the buffer.
§Arguments
last
- A boolean indicating whether the buffer is the last buffer in a request.
Sourcefn set_last_in_chain(&mut self, last: bool)
fn set_last_in_chain(&mut self, last: bool)
Sets the last_in_chain
flag of the buffer.
§Arguments
last
- A boolean indicating whether the buffer is the last buffer in a chain of buffers.