[−][src]Struct swim_mem::resident::String
A resizeable array of Unicode code points, residing in a memory Lease
.
A String
is a Resident
typeclass; it doesn't store any data in its
internal structure. Rather, String
implements an access pattern for
memory blocks managed by a Lease
. A composing Lease
type defines the
memory allocation and ownership semantics of the composed String
type.
Lease
implementations commonly composed with a String
include:
Own<String>
: the exclusive owner of a relocatable, resizeable string.Mut<String>
: a mutably dereferenceable strong owner of an unrelocatable, resizeable string.Ref<String>
: an immutably dereferenceable strong owner of an unrelocatable, resizeable string.Hard<String>
: an undereferenceable strong owner of a relocatable string.Soft<String>
: an undereferenceable weak owner of a relocatable string.
String
implements LeaseDeref
, and LeaseDerefMut
, which enables deref
coercions from Own<String>
, Mut<String>
, and Ref<String>
to
&StringLease<L>
. StringLease
in turn deref coerces to &str
and
&mut str
. This makes leased strings "feel" like they contain a str
,
even though String
is just a typeclass for accessing the str
stored in
the composing memory Lease
. Most string operations are defined on
StringLease
; String
can't do much on its own since it doesn't actually
contain any data.
Trait Implementations
impl<M> Resident for String<M>
[src]
type Data = u8
The type of pointed-to data stored in leased memory blocks. The size of leased memory blocks must be a positive multiple of the Data
size. Read more
type Meta = BufHeader<M>
The type of metadata stored with leased memory blocks. Meta
data must contain sufficient information to resolve the size of any resided-in memory Lease
. Read more
unsafe fn resident_size(_data: *mut u8, meta: *mut BufHeader<M>) -> usize
[src]
unsafe fn resident_drop(_data: *mut u8, _meta: *mut BufHeader<M>)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentFromCopy<L, str, M> for String<M>
[src]
fn new_resident_layout(data: &str, _meta: &M) -> Layout
[src]
fn new_resident_ptr(raw: *mut u8, _data: &str, _meta: &M) -> *mut u8
[src]
fn new_resident(lease: &mut L, data: &str, meta: M)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentFromEmpty<L, M> for String<M>
[src]
fn new_resident_layout(_meta: &M) -> Layout
[src]
fn new_resident_ptr(raw: *mut u8, _meta: &M) -> *mut u8
[src]
fn new_resident(lease: &mut L, meta: M)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentWithCapacity<L, M> for String<M>
[src]
fn new_resident_layout(cap: usize, _meta: &M) -> Result<Layout, LayoutError>
[src]
fn new_resident_ptr(raw: *mut u8, _cap: usize, _meta: &M) -> *mut u8
[src]
fn new_resident(lease: &mut L, cap: usize, meta: M)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentDeref<L> for String<M>
[src]
type Target = StringLease<L, M>
The type the resident dereferences to.
fn resident_deref(lease: &L) -> &StringLease<L, M>
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentDerefMut<L> for String<M>
[src]
fn resident_deref_mut(lease: &mut L) -> &mut StringLease<L, M>
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentAsRef<L, str> for String<M>
[src]
fn resident_as_ref(lease: &L) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentAsRef<L, [u8]> for String<M>
[src]
fn resident_as_ref(lease: &L) -> &[u8]
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, Range<usize>> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: Range<usize>) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, RangeFrom<usize>> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: RangeFrom<usize>) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, RangeFull> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: RangeFull) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, RangeInclusive<usize>> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: RangeInclusive<usize>) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, RangeTo<usize>> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: RangeTo<usize>) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndex<L, RangeToInclusive<usize>> for String<M>
[src]
type Output = str
The type of values indexed by the resident for the parameterized Idx
type.
fn resident_index(lease: &L, index: RangeToInclusive<usize>) -> &str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, Range<usize>> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: Range<usize>) -> &mut str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, RangeFrom<usize>> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: RangeFrom<usize>) -> &mut str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, RangeFull> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: RangeFull) -> &mut str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, RangeInclusive<usize>> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: RangeInclusive<usize>) -> &mut str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, RangeTo<usize>> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: RangeTo<usize>) -> &mut str
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentIndexMut<L, RangeToInclusive<usize>> for String<M>
[src]
fn resident_index_mut(lease: &mut L, index: RangeToInclusive<usize>) -> &mut str
[src]
impl<'a, 'b, L: DynamicLease<'a, Data = u8, Meta = BufHeader<M>>, M> ResidentAdd<L, &'b str> for String<M>
[src]
type Output = L
The resulting type of applying the +
operator.
fn resident_add(lease: L, rhs: &'b str) -> L
[src]
impl<'a, 'b, L: DynamicLease<'a, Data = u8, Meta = BufHeader<M>>, M> ResidentAddAssign<L, &'b str> for String<M>
[src]
fn resident_add_assign(lease: &mut L, rhs: &'b str)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentPartialEq<L, L> for String<M>
[src]
fn resident_eq(lease: &L, other: &L) -> bool
[src]
fn resident_ne(lease: &L, other: &L) -> bool
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentEq<L> for String<M>
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentPartialOrd<L, L> for String<M>
[src]
fn resident_partial_cmp(lease: &L, other: &L) -> Option<Ordering>
[src]
fn resident_lt(lease: &L, other: &L) -> bool
[src]
fn resident_le(lease: &L, other: &L) -> bool
[src]
fn resident_ge(lease: &L, other: &L) -> bool
[src]
fn resident_gt(lease: &L, other: &L) -> bool
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentOrd<L> for String<M>
[src]
fn resident_cmp(lease: &L, other: &L) -> Ordering
[src]
fn resident_lt(lease: &L, other: &L) -> bool
[src]
fn resident_le(lease: &L, other: &L) -> bool
[src]
fn resident_ge(lease: &L, other: &L) -> bool
[src]
fn resident_gt(lease: &L, other: &L) -> bool
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentHash<L> for String<M>
[src]
fn resident_hash<H: Hasher>(lease: &L, state: &mut H)
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentDisplay<L> for String<M>
[src]
fn resident_fmt(lease: &L, f: &mut Formatter) -> Result
[src]
impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentDebug<L> for String<M>
[src]
fn resident_fmt(lease: &L, f: &mut Formatter) -> Result
[src]
impl<L1, L2, M> ResidentClone<L1, L2> for String<M> where
L1: Lease<Data = u8, Meta = BufHeader<M>>,
L2: Lease<Data = u8, Meta = BufHeader<M>>,
M: TryClone,
[src]
L1: Lease<Data = u8, Meta = BufHeader<M>>,
L2: Lease<Data = u8, Meta = BufHeader<M>>,
M: TryClone,
fn new_resident_layout(lease: &L1) -> Layout
[src]
fn resident_clone(src: &L1, dst: &mut L2) -> Result<(), HoldError>
[src]
impl<'b, L1, L2, M> ResidentStow<'b, L1, L2> for String<M> where
L1: Lease<Data = u8, Meta = BufHeader<M>>,
L2: Lease<Data = u8, Meta = BufHeader<M>>,
M: TryClone,
[src]
L1: Lease<Data = u8, Meta = BufHeader<M>>,
L2: Lease<Data = u8, Meta = BufHeader<M>>,
M: TryClone,
fn new_resident_layout(lease: &L1) -> Layout
[src]
unsafe fn resident_stow(
src: &mut L1,
dst: &mut L2,
_hold: &dyn Hold<'b>
) -> Result<(), HoldError>
[src]
src: &mut L1,
dst: &mut L2,
_hold: &dyn Hold<'b>
) -> Result<(), HoldError>
unsafe fn resident_unstow(_src: &mut L1, _dst: &mut L2)
[src]
impl<M: Sync> Sync for String<M>
[src]
impl<M: Send> Send for String<M>
[src]
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,