impl<T> From<PushError<T>> for Error { fn from(_: PushError<T>) -> Error { // Returning ENOMEM isn't appropriate because the system is not out of memory. The vector // is just full and we are refusing to resize it.
EINVAL
}
}
/// Error type for [`Vec::remove`]. pubstruct RemoveError;
impl Debug for RemoveError { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "Index out of bounds")
}
}
/// Error type for [`Vec::insert_within_capacity`]. pubenum InsertError<T> { /// The value could not be inserted because the index is out of bounds.
IndexOutOfBounds(T), /// The value could not be inserted because the vector is out of capacity.
OutOfCapacity(T),
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.