pub struct NewtypeBuf<Marker, T = String> { /* private fields */ }
Expand description
Newtype wrapper for strings
Implementations§
Source§impl<Marker> NewtypeBuf<Marker>
impl<Marker> NewtypeBuf<Marker>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new empty buffer with at least the specified capacity.
pub fn as_mut_str(&mut self) -> &mut str
Trait Implementations§
Source§impl<Marker, T, R> AsRef<R> for NewtypeBuf<Marker, T>
impl<Marker, T, R> AsRef<R> for NewtypeBuf<Marker, T>
Source§impl<Marker, T> Borrow<NewtypeRef<Marker, T>> for NewtypeBuf<Marker, T>where
T: Deref,
impl<Marker, T> Borrow<NewtypeRef<Marker, T>> for NewtypeBuf<Marker, T>where
T: Deref,
Source§fn borrow(&self) -> &NewtypeRef<Marker, T>
fn borrow(&self) -> &NewtypeRef<Marker, T>
Immutably borrows from an owned value. Read more
Source§impl<Marker, T: Clone> Clone for NewtypeBuf<Marker, T>
impl<Marker, T: Clone> Clone for NewtypeBuf<Marker, T>
Source§impl<Marker, T: Debug> Debug for NewtypeBuf<Marker, T>
impl<Marker, T: Debug> Debug for NewtypeBuf<Marker, T>
Source§impl<Marker, T: Default> Default for NewtypeBuf<Marker, T>
impl<Marker, T: Default> Default for NewtypeBuf<Marker, T>
Source§impl<Marker, T> Deref for NewtypeBuf<Marker, T>where
T: Deref,
impl<Marker, T> Deref for NewtypeBuf<Marker, T>where
T: Deref,
Source§impl<Marker, T> Display for NewtypeBuf<Marker, T>where
T: Display,
impl<Marker, T> Display for NewtypeBuf<Marker, T>where
T: Display,
Source§impl<'a, Marker, T> From<&'a str> for NewtypeBuf<Marker, T>
impl<'a, Marker, T> From<&'a str> for NewtypeBuf<Marker, T>
Source§impl<Marker, T> From<String> for NewtypeBuf<Marker, T>
impl<Marker, T> From<String> for NewtypeBuf<Marker, T>
Source§impl<Marker, T: Hash> Hash for NewtypeBuf<Marker, T>
impl<Marker, T: Hash> Hash for NewtypeBuf<Marker, T>
Source§impl<Marker, T: PartialEq> PartialEq for NewtypeBuf<Marker, T>
impl<Marker, T: PartialEq> PartialEq for NewtypeBuf<Marker, T>
Source§impl<Marker, T> TransparentWrapper<T> for NewtypeBuf<Marker, T>
impl<Marker, T> TransparentWrapper<T> for NewtypeBuf<Marker, T>
Source§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
Source§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
Source§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
Source§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
Source§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
Source§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
Source§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
Source§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
impl<Marker, T: Eq> Eq for NewtypeBuf<Marker, T>
Auto Trait Implementations§
impl<Marker, T> Freeze for NewtypeBuf<Marker, T>where
T: Freeze,
impl<Marker, T> RefUnwindSafe for NewtypeBuf<Marker, T>where
T: RefUnwindSafe,
Marker: RefUnwindSafe,
impl<Marker, T> Send for NewtypeBuf<Marker, T>
impl<Marker, T> Sync for NewtypeBuf<Marker, T>
impl<Marker, T> Unpin for NewtypeBuf<Marker, T>
impl<Marker, T> UnwindSafe for NewtypeBuf<Marker, T>where
T: UnwindSafe,
Marker: 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