pub struct BulkString(/* private fields */);
Implementations§
Source§impl BulkString
impl BulkString
Sourcepub fn new(input: &[u8]) -> Self
pub fn new(input: &[u8]) -> Self
Build a new Bulk String
use resp_protocol::BulkString;
let bulk_string: BulkString = BulkString::new(b"foobar");
println!("{:?}", bulk_string); // BulkString(b"$6\r\nfoobar\r\n")
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
use resp_protocol::{BulkString, EMPTY_BULK_STRING};
let bulk_string: BulkString = EMPTY_BULK_STRING;
println!("{:?}", bulk_string.is_empty()); // true
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
use resp_protocol::{BulkString, NULL_BULK_STRING};
let bulk_string: BulkString = NULL_BULK_STRING;
println!("{:?}", bulk_string.is_null()); // true
pub fn bytes(&self) -> Bytes
pub fn len(&self) -> usize
pub fn from_bytes(input: Bytes) -> Self
pub fn from_slice(input: &[u8]) -> Self
pub unsafe fn from_raw(ptr: *mut u8, length: usize) -> Self
pub fn while_valid( input: &[u8], start: &mut usize, end: &usize, ) -> Result<(), RespError>
pub fn parse( input: &[u8], start: &mut usize, end: &usize, ) -> Result<Self, RespError>
Trait Implementations§
Source§impl Clone for BulkString
impl Clone for BulkString
Source§fn clone(&self) -> BulkString
fn clone(&self) -> BulkString
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 BulkString
impl Debug for BulkString
Source§impl<'a> PartialEq<BulkString> for &'a BulkString
impl<'a> PartialEq<BulkString> for &'a BulkString
Source§fn eq(&self, other: &BulkString) -> bool
fn eq(&self, other: &BulkString) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§fn ne(&self, other: &BulkString) -> bool
fn ne(&self, other: &BulkString) -> bool
Tests for
!=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.Source§impl PartialEq for BulkString
impl PartialEq for BulkString
impl StructuralPartialEq for BulkString
Auto Trait Implementations§
impl !Freeze for BulkString
impl RefUnwindSafe for BulkString
impl Send for BulkString
impl Sync for BulkString
impl Unpin for BulkString
impl UnwindSafe for BulkString
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