pub struct Exception(pub Value);Expand description
A signal of some sort of erroneous condition.
Tuple Fields§
§0: ValueImplementations§
Source§impl Exception
impl Exception
pub fn error(message: impl Display) -> Self
pub fn syntax(form: Syntax, subform: Option<Syntax>) -> Self
pub fn undefined(ident: Identifier) -> Self
pub fn type_error(expected: &str, provided: &str) -> Self
pub fn invalid_operator(provided: &str) -> Self
pub fn invalid_index(index: usize, len: usize) -> Self
pub fn invalid_range(range: Range<usize>, len: usize) -> Self
pub fn wrong_num_of_unicode_chars(expected: usize, provided: usize) -> Self
pub fn wrong_num_of_args(expected: usize, provided: usize) -> Self
pub fn wrong_num_of_var_args(expected: Range<usize>, provided: usize) -> Self
pub fn implementation_restriction(msg: impl Display) -> Self
Sourcepub fn conversion_error(expected: &str, provided: &str) -> Self
pub fn conversion_error(expected: &str, provided: &str) -> Self
For when we cannot convert a value into the requested type.
Example: Integer to a Complex
Sourcepub fn not_representable(value: &str, type: &str) -> Self
pub fn not_representable(value: &str, type: &str) -> Self
For when we cannot represent the value into the requested type.
Example: an u128 number as an u8
pub fn io_error(message: impl Display) -> Self
pub fn io_read_error(message: impl Display) -> Self
pub fn io_write_error(message: impl Display) -> Self
pub fn invalid_record_index(k: usize) -> Self
pub fn add_condition(self, condition: impl SchemeCompatible) -> Self
pub fn simple_conditions(&self) -> Result<Vec<Value>, Exception>
pub fn condition<T: SchemeCompatible>(&self) -> Result<Option<Gc<T>>, Exception>
Trait Implementations§
Source§impl From<Exception> for LexerError
impl From<Exception> for LexerError
Source§impl From<Infallible> for Exception
impl From<Infallible> for Exception
Source§fn from(infallible: Infallible) -> Self
fn from(infallible: Infallible) -> Self
Converts to this type from the input type.
Source§impl From<ParseSyntaxError> for Exception
impl From<ParseSyntaxError> for Exception
Source§fn from(error: ParseSyntaxError) -> Self
fn from(error: ParseSyntaxError) -> Self
Converts to this type from the input type.
Source§impl From<SimpleCondition> for Exception
impl From<SimpleCondition> for Exception
Source§fn from(simple: SimpleCondition) -> Self
fn from(simple: SimpleCondition) -> Self
Converts to this type from the input type.
Source§impl From<TryFromIntError> for Exception
impl From<TryFromIntError> for Exception
Source§fn from(e: TryFromIntError) -> Self
fn from(e: TryFromIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Exception
impl RefUnwindSafe for Exception
impl Send for Exception
impl Sync for Exception
impl Unpin for Exception
impl UnwindSafe for Exception
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more