Enum Error
#[non_exhaustive]pub enum Error {
Show 13 variants
Compile(CompileErrors),
Exception(RuntimeError),
MissingScriptType,
InputValueNotFound {
id: usize,
},
SetInputValue {
id: usize,
error: String,
},
UnsupportedTimeFrame {
time_frame: TimeFrame,
},
SessionNotAllowed {
session: TradeSession,
},
InvalidSymbol,
UnknownMarket,
LibraryScriptNotExecutable,
DataProvider {
message: String,
},
ConfirmedBarUpdate,
JitCompilation {
message: String,
},
}Expand description
Unified error type for script compilation and execution.
This enum covers all errors that can occur when building or running an Navi instance. It is serialisable and can be sent over the wire.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Compile(CompileErrors)
One or more compilation errors.
Exception(RuntimeError)
A runtime exception.
MissingScriptType
The script is missing an indicator/strategy/library declaration.
InputValueNotFound
An input.*() call referenced a non-existent input index.
SetInputValue
Failed to serialize an input value override.
UnsupportedTimeFrame
The requested time frame is not supported.
SessionNotAllowed
The trade session is not allowed for this symbol.
Fields
session: TradeSessionThe disallowed session.
InvalidSymbol
The symbol string has an invalid format (expected PREFIX:TICKER).
UnknownMarket
The symbol prefix does not map to a known market.
LibraryScriptNotExecutable
Library scripts cannot be executed directly.
DataProvider
The data provider returned an error.
ConfirmedBarUpdate
Attempted to update a bar that has already been confirmed.
JitCompilation
JIT compilation failed.
Trait Implementations§
§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Error, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Error, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Error for Error
impl Error for Error
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl From<RuntimeError> for Error
impl From<RuntimeError> for Error
§fn from(source: RuntimeError) -> Error
fn from(source: RuntimeError) -> Error
§impl Serialize for Error
impl Serialize for Error
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
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>
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>
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.