pub struct ByteString { /* private fields */ }Expand description
A bounded, Copy byte string backing the variable-length CANopen types
(VISIBLE_STRING, OCTET_STRING, DOMAIN): up to MAX_STRING_LEN bytes.
Implementations§
Source§impl ByteString
impl ByteString
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Build from a byte slice, returning Error::BadLength if it is longer
than MAX_STRING_LEN.
Sourcepub fn from_str(s: &str) -> Result<Self>
pub fn from_str(s: &str) -> Result<Self>
Build from a string slice (a VISIBLE_STRING), returning
Error::BadLength if it is longer than MAX_STRING_LEN.
Trait Implementations§
Source§impl Clone for ByteString
impl Clone for ByteString
Source§fn clone(&self) -> ByteString
fn clone(&self) -> ByteString
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ByteString
Source§impl Debug for ByteString
impl Debug for ByteString
Source§impl Default for ByteString
impl Default for ByteString
impl Eq for ByteString
Auto Trait Implementations§
impl Freeze for ByteString
impl RefUnwindSafe for ByteString
impl Send for ByteString
impl Sync for ByteString
impl Unpin for ByteString
impl UnsafeUnpin for ByteString
impl UnwindSafe for ByteString
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