Struct kwap::resp::RespCore [−][src]
pub struct RespCore<Bytes: Array<u8>, OptBytes: Array<u8> + 'static, Opts: Array<Opt<OptBytes>>, OptNumbers: Array<(OptNumber, Opt<OptBytes>)>> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>, { /* fields omitted */ }
Expand description
TODO: ser/de support
Implementations
impl<Bytes: Array<u8>, OptBytes: Array<u8> + 'static, Opts: Array<Opt<OptBytes>>, OptNumbers: Array<(OptNumber, Opt<OptBytes>)>> RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
impl<Bytes: Array<u8>, OptBytes: Array<u8> + 'static, Opts: Array<Opt<OptBytes>>, OptNumbers: Array<(OptNumber, Opt<OptBytes>)>> RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
Create a new response for a given request
TODO: replace msg with Request type
pub fn set_option<V: IntoIterator<Item = u8>>(
&mut self,
number: u32,
value: V
) -> Option<(u32, V)>
pub fn set_option<V: IntoIterator<Item = u8>>(
&mut self,
number: u32,
value: V
) -> Option<(u32, V)>
Add a custom option to the response
If there was no room in the collection, returns the arguments back as Some(number, value)
.
Otherwise, returns None
.
Add a payload to this response
Trait Implementations
impl<Bytes: Clone + Array<u8>, OptBytes: Clone + Array<u8> + 'static, Opts: Clone + Array<Opt<OptBytes>>, OptNumbers: Clone + Array<(OptNumber, Opt<OptBytes>)>> Clone for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
impl<Bytes: Clone + Array<u8>, OptBytes: Clone + Array<u8> + 'static, Opts: Clone + Array<Opt<OptBytes>>, OptNumbers: Clone + Array<(OptNumber, Opt<OptBytes>)>> Clone for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
impl<Bytes: Debug + Array<u8>, OptBytes: Debug + Array<u8> + 'static, Opts: Debug + Array<Opt<OptBytes>>, OptNumbers: Debug + Array<(OptNumber, Opt<OptBytes>)>> Debug for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
impl<Bytes: Debug + Array<u8>, OptBytes: Debug + Array<u8> + 'static, Opts: Debug + Array<Opt<OptBytes>>, OptNumbers: Debug + Array<(OptNumber, Opt<OptBytes>)>> Debug for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
for<'a> &'a OptBytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Bytes: IntoIterator<Item = &'a u8>,
for<'a> &'a Opts: IntoIterator<Item = &'a Opt<OptBytes>>,
for<'a> &'a OptNumbers: IntoIterator<Item = &'a (OptNumber, Opt<OptBytes>)>,
Auto Trait Implementations
impl<Bytes, OptBytes, Opts, OptNumbers> RefUnwindSafe for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
Bytes: RefUnwindSafe,
OptBytes: RefUnwindSafe,
OptNumbers: RefUnwindSafe,
Opts: RefUnwindSafe,
impl<Bytes, OptBytes, Opts, OptNumbers> Send for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
Bytes: Send,
OptBytes: Send,
OptNumbers: Send,
Opts: Send,
impl<Bytes, OptBytes, Opts, OptNumbers> Sync for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
Bytes: Sync,
OptBytes: Sync,
OptNumbers: Sync,
Opts: Sync,
impl<Bytes, OptBytes, Opts, OptNumbers> Unpin for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
Bytes: Unpin,
OptBytes: Unpin,
OptNumbers: Unpin,
Opts: Unpin,
impl<Bytes, OptBytes, Opts, OptNumbers> UnwindSafe for RespCore<Bytes, OptBytes, Opts, OptNumbers> where
Bytes: UnwindSafe,
OptBytes: UnwindSafe,
OptNumbers: UnwindSafe,
Opts: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more