pub struct NoCapacityError(/* private fields */);
Expand description
An error indicating that there was no capacity remaining when a push was attempted.
You should MapInPlace::pop
more characters in order to make room for a push.
Keep in mind that not every UTF-8 character is the same size, so you may get this error even if you always have more pops than pushes, if you are pushing larger characters.
§Examples
use in_place_string_map::{MapInPlace, NoCapacityError};
let mut string = String::from("$");
let mut map = MapInPlace::new(&mut string);
map.pop();
let error: NoCapacityError = map.push('£').unwrap_err();
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NoCapacityError
impl RefUnwindSafe for NoCapacityError
impl Send for NoCapacityError
impl Sync for NoCapacityError
impl Unpin for NoCapacityError
impl UnwindSafe for NoCapacityError
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