Struct tokio_dbus::SignatureBuf
source · pub struct SignatureBuf { /* private fields */ }
Expand description
A D-Bus signature.
This is the owned variant which dereferences to Signature
.
Implementations§
source§impl SignatureBuf
impl SignatureBuf
sourcepub const fn empty() -> SignatureBuf
pub const fn empty() -> SignatureBuf
Construct a new empty signature.
§Examples
use tokio_dbus::SignatureBuf;
let sig = SignatureBuf::empty();
assert!(sig.is_empty());
sourcepub const fn into_raw_parts(self) -> ([MaybeUninit<u8>; 256], usize)
pub const fn into_raw_parts(self) -> ([MaybeUninit<u8>; 256], usize)
Convert an owned signature into its raw parts.
sourcepub const fn new_const(signature: &[u8]) -> SignatureBuf
pub const fn new_const(signature: &[u8]) -> SignatureBuf
Construct a new signature with validation inside of a constant context.
This will panic in case the signature is invalid.
ⓘ
use tokio_dbus::SignatureBuf;
const BAD: SignatureBuf = SignatureBuf::new_const(b"(a)");
§Examples
use tokio_dbus::SignatureBuf;
const SIG: SignatureBuf = SignatureBuf::new_const(b"i(ai)");
sourcepub fn new(signature: &[u8]) -> Result<SignatureBuf, SignatureError>
pub fn new(signature: &[u8]) -> Result<SignatureBuf, SignatureError>
Try to construct a new signature with validation.
Methods from Deref<Target = Signature>§
pub const EMPTY: &'static Signature = _
pub const SIGNATURE: &'static Signature = _
pub const OBJECT_PATH: &'static Signature = _
pub const STRING: &'static Signature = _
pub const VARIANT: &'static Signature = _
pub const BYTE: &'static Signature = _
pub const INT16: &'static Signature = _
pub const UINT16: &'static Signature = _
pub const INT32: &'static Signature = _
pub const UINT32: &'static Signature = _
pub const INT64: &'static Signature = _
pub const UINT64: &'static Signature = _
pub const DOUBLE: &'static Signature = _
pub const UNIX_FD: &'static Signature = _
pub fn iter(&self) -> Iter<'_>
Trait Implementations§
source§impl AsRef<Signature> for SignatureBuf
impl AsRef<Signature> for SignatureBuf
source§impl Borrow<Signature> for SignatureBuf
impl Borrow<Signature> for SignatureBuf
source§impl Clone for SignatureBuf
impl Clone for SignatureBuf
source§fn clone(&self) -> SignatureBuf
fn clone(&self) -> SignatureBuf
Returns a copy 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 SignatureBuf
impl Debug for SignatureBuf
source§impl Deref for SignatureBuf
impl Deref for SignatureBuf
source§impl PartialEq<&Signature> for SignatureBuf
impl PartialEq<&Signature> for SignatureBuf
Equality check between a borrowed Signature
and SignatureBuf
.
§Examples
use tokio_dbus::{Signature, SignatureBuf};
assert_eq!(SignatureBuf::empty(), *Signature::EMPTY);
assert_eq!(SignatureBuf::new(b"s")?, *Signature::STRING);
source§impl PartialEq<Signature> for SignatureBuf
impl PartialEq<Signature> for SignatureBuf
Equality check between Signature
and SignatureBuf
.
§Examples
use tokio_dbus::{Signature, SignatureBuf};
assert_eq!(SignatureBuf::empty(), *Signature::EMPTY);
assert_eq!(SignatureBuf::new(b"s")?, *Signature::STRING);
source§impl PartialEq<SignatureBuf> for &Signature
impl PartialEq<SignatureBuf> for &Signature
Equality check between SignatureBuf
and a borrowed Signature
.
§Examples
use tokio_dbus::{Signature, SignatureBuf};
assert_eq!(Signature::EMPTY, SignatureBuf::empty());
assert_eq!(Signature::STRING, SignatureBuf::new(b"s")?);
source§fn eq(&self, other: &SignatureBuf) -> bool
fn eq(&self, other: &SignatureBuf) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<SignatureBuf> for Signature
impl PartialEq<SignatureBuf> for Signature
Equality check between SignatureBuf
and Signature
.
§Examples
use tokio_dbus::{Signature, SignatureBuf};
assert_eq!(*Signature::EMPTY, SignatureBuf::empty());
assert_eq!(*Signature::STRING, SignatureBuf::new(b"s")?);
source§fn eq(&self, other: &SignatureBuf) -> bool
fn eq(&self, other: &SignatureBuf) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for SignatureBuf
impl PartialEq for SignatureBuf
Equality check between SignatureBuf
and SignatureBuf
.
§Examples
use tokio_dbus::{Signature, SignatureBuf};
assert_eq!(SignatureBuf::empty(), Signature::EMPTY.to_owned());
assert_eq!(SignatureBuf::new(b"s")?, Signature::STRING.to_owned());
source§fn eq(&self, other: &SignatureBuf) -> bool
fn eq(&self, other: &SignatureBuf) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SignatureBuf
Auto Trait Implementations§
impl RefUnwindSafe for SignatureBuf
impl Send for SignatureBuf
impl Sync for SignatureBuf
impl Unpin for SignatureBuf
impl UnwindSafe for SignatureBuf
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