pub struct String<'a>(/* private fields */);Expand description
A reference to a text string.
Implementations§
Source§impl<'a> String<'a>
impl<'a> String<'a>
Sourcepub const unsafe fn new(data: &'a str) -> Self
pub const unsafe fn new(data: &'a str) -> Self
Wraps a string in a string external reference.
§Safety
It is not actually unsafe to construct a String object. However, if the caller then
CBOR-encodes the resulting object, they must ensure that the String object remains in
existence until the CBOR data has been submitted as part of a method call. Failure to do
this would allow the referent to be modified or dropped, resulting in OC-Wasm reading from
that reused memory.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for String<'a>
impl<'a> RefUnwindSafe for String<'a>
impl<'a> Send for String<'a>
impl<'a> Sync for String<'a>
impl<'a> Unpin for String<'a>
impl<'a> UnwindSafe for String<'a>
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