mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 15:14:35 +00:00
Some complement to the SharedString docs
This commit is contained in:
parent
12c0ef38fb
commit
34ea35d32b
1 changed files with 4 additions and 1 deletions
|
@ -22,9 +22,12 @@ use core::ops::Deref;
|
|||
///
|
||||
/// SharedString uses implicit data sharing to make it efficient to pass around copies. When
|
||||
/// cloning, a reference to the data is cloned, not the data itself. The data itself is only copied
|
||||
/// when modifying it, for example using [push_str](#method.push_str). This is also called copy-on-write.
|
||||
/// when modifying it, for example using [push_str](SharedString::push_str). This is also called copy-on-write.
|
||||
///
|
||||
/// Under the hood the string data is UTF-8 encoded and it is always terminated with a null character.
|
||||
///
|
||||
/// `SharedString` implements [`Deref<Target=str>`] so it can be easily passed to any function taking a `&str`.
|
||||
/// It also implement `From` such that it an easily be converted to and from the typical rust String type with `.into()`
|
||||
#[derive(Clone, Default)]
|
||||
#[repr(C)]
|
||||
pub struct SharedString {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue