pub struct Array<T>(/* private fields */);
Expand description
The Marker
for an array type, like [u8]
.
§Examples
use tokio_dbus::{BodyBuf, Signature};
use tokio_dbus::ty;
let mut buf = BodyBuf::new();
buf.store_struct::<(u8, ty::Array<ty::Str>)>()?
.store(42u8)
.store_array(|w| {
w.store("Hello");
w.store("World");
})
.finish();
assert_eq!(buf.signature(), b"(yas)");
let mut b = buf.as_body();
let (n, mut array) = b.load_struct::<(u8, ty::Array<ty::Str>)>()?;
assert_eq!(n, 42u8);
assert_eq!(array.read()?, Some("Hello"));
assert_eq!(array.read()?, Some("World"));
assert_eq!(array.read()?, None);
Trait Implementations§
impl<T> Aligned for Array<T>where
T: Aligned,
impl<T> Marker for Array<T>where
T: Marker,
Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> Send for Array<T>where
T: Send,
impl<T> Sync for Array<T>where
T: Sync,
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> UnwindSafe for Array<T>where
T: UnwindSafe,
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