Struct zerotier_central_api::ResponseValue
source · pub struct ResponseValue<T> { /* private fields */ }
Expand description
Typed value returned by generated client methods.
This is used for successful responses and may appear in error responses
generated from the server (see Error::ErrorResponse
)
Implementations§
source§impl<T> ResponseValue<T>
impl<T> ResponseValue<T>
sourcepub fn new(
inner: T,
status: StatusCode,
headers: HeaderMap<HeaderValue>
) -> ResponseValue<T>
pub fn new( inner: T, status: StatusCode, headers: HeaderMap<HeaderValue> ) -> ResponseValue<T>
Creates a ResponseValue
from the inner type, status, and headers.
Useful for generating test fixtures.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the ResponseValue, returning the wrapped value.
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Gets the status from this response.
sourcepub fn headers(&self) -> &HeaderMap<HeaderValue>
pub fn headers(&self) -> &HeaderMap<HeaderValue>
Gets the headers from this response.
sourcepub fn content_length(&self) -> Option<u64>
pub fn content_length(&self) -> Option<u64>
Gets the parsed value of the Content-Length header, if present and valid.