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 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 SignatureBuf
impl Debug for SignatureBuf
Source§impl Deref for SignatureBuf
impl Deref for SignatureBuf
Source§impl PartialEq<&Signature> for SignatureBuf
Equality check between a borrowed Signature
and 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
Equality check between Signature
and 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
Equality check between SignatureBuf
and a borrowed 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§impl PartialEq<SignatureBuf> for Signature
Equality check between SignatureBuf
and 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§impl PartialEq for SignatureBuf
Equality check between SignatureBuf
and 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());
impl Eq for SignatureBuf
Auto Trait Implementations§
impl Freeze for SignatureBuf
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