pub struct CommandBuilder { /* private fields */ }
Expand description
Builder for constructing RESP2/3 frames
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
pub fn new(keyword: &'static str) -> Self
Sourcepub fn to_command(self) -> CustomCommand
pub fn to_command(self) -> CustomCommand
Converts builder to command ready for being sent by Client
Sourcepub fn arg_static(self, arg: &'static str) -> Self
pub fn arg_static(self, arg: &'static str) -> Self
Adds a static argument
Sourcepub fn arg_static_option(self, arg: Option<&'static str>) -> Self
pub fn arg_static_option(self, arg: Option<&'static str>) -> Self
Adds a static argument
Sourcepub fn arg(self, arg: &Bytes) -> Self
pub fn arg(self, arg: &Bytes) -> Self
Adds a byte argument Note: Besides static, the most efficient way caused by the nature how Bytes cloning is working
Sourcepub fn arg_option(self, arg: Option<&Bytes>) -> Self
pub fn arg_option(self, arg: Option<&Bytes>) -> Self
Just adding byte if option is Some
Trait Implementations§
Source§impl Clone for CommandBuilder
impl Clone for CommandBuilder
Source§fn clone(&self) -> CommandBuilder
fn clone(&self) -> CommandBuilder
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 Default for CommandBuilder
impl Default for CommandBuilder
Source§fn default() -> CommandBuilder
fn default() -> CommandBuilder
Returns the “default value” for a type. Read more
Source§impl From<CommandBuilder> for BytesFrame
impl From<CommandBuilder> for BytesFrame
Source§fn from(builder: CommandBuilder) -> Self
fn from(builder: CommandBuilder) -> Self
Converts to this type from the input type.
Source§impl From<CommandBuilder> for BytesFrame
impl From<CommandBuilder> for BytesFrame
Source§fn from(builder: CommandBuilder) -> Self
fn from(builder: CommandBuilder) -> Self
Converts to this type from the input type.
Source§impl From<CommandBuilder> for CustomCommand
impl From<CommandBuilder> for CustomCommand
Source§fn from(builder: CommandBuilder) -> Self
fn from(builder: CommandBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommandBuilder
impl RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl UnwindSafe for CommandBuilder
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more