pub struct ControlResponse {
pub status_code: u64,
pub status_text: String,
pub body: Option<ControlParameters>,
}Expand description
NFD ControlResponse.
Fields§
§status_code: u64§status_text: String§body: Option<ControlParameters>Optional body — typically echoed ControlParameters on success.
Implementations§
Source§impl ControlResponse
impl ControlResponse
Sourcepub fn ok(text: impl Into<String>, body: ControlParameters) -> Self
pub fn ok(text: impl Into<String>, body: ControlParameters) -> Self
Create a 200 OK response with echoed parameters.
Sourcepub fn encode(&self) -> Bytes
pub fn encode(&self) -> Bytes
Encode to wire format as a complete ControlResponse TLV (type 0x65).
Sourcepub fn decode(wire: Bytes) -> Result<Self, ControlResponseError>
pub fn decode(wire: Bytes) -> Result<Self, ControlResponseError>
Decode from a complete ControlResponse TLV (type 0x65).
Sourcepub fn decode_value(value: Bytes) -> Result<Self, ControlResponseError>
pub fn decode_value(value: Bytes) -> Result<Self, ControlResponseError>
Decode from the inner value bytes (without the outer 0x65 wrapper).
Trait Implementations§
Source§impl Clone for ControlResponse
impl Clone for ControlResponse
Source§fn clone(&self) -> ControlResponse
fn clone(&self) -> ControlResponse
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 ControlResponse
impl Debug for ControlResponse
Source§impl PartialEq for ControlResponse
impl PartialEq for ControlResponse
impl Eq for ControlResponse
impl StructuralPartialEq for ControlResponse
Auto Trait Implementations§
impl !Freeze for ControlResponse
impl RefUnwindSafe for ControlResponse
impl Send for ControlResponse
impl Sync for ControlResponse
impl Unpin for ControlResponse
impl UnwindSafe for ControlResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.