Struct LogicError

Source
pub struct LogicError {
    pub id: u32,
    pub kind: LogicErrorKind,
    pub design_reference: Option<Arc<dyn Reference>>,
}
Expand description

Handles and describe a Mélodium logic error.

Fields§

§id: u32

Identifier of error.

§kind: LogicErrorKind

Kind of error.

§design_reference: Option<Arc<dyn Reference>>

Optional design reference attached to error.

Implementations§

Source§

impl LogicError

Source

pub fn collection_undefined( id: u32, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::CollectionUndefined kind.

Source

pub fn uncommited_descriptor( id: u32, identifier: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UncommitedDescriptor kind.

Source

pub fn no_designer( id: u32, identifier: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::NoDesigner kind.

Source

pub fn erroneous_design( id: u32, identifier: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ErroneousDesign kind.

Source

pub fn erroneous_checks( id: u32, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ErroneousChecks kind.

Source

pub fn unavailable_design( id: u32, identifier: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnavailableDesign kind.

Source

pub fn launch_expect_treatment(id: u32, wrong_identifier: Identifier) -> Self

Generates a new error with LogicErrorKind::LaunchExpectTreatment kind.

Source

pub fn launch_wrong_parameter(id: u32, parameter: String) -> Self

Source

pub fn unexisting_variable( id: u32, identifier: Identifier, parameter: String, variable: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingVariable kind.

Source

pub fn unexisting_context_variable( id: u32, identifier: Identifier, parameter: String, context: Identifier, variable: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingContextVariable kind.

Source

pub fn unexisting_parameter( id: u32, scope: Identifier, called: Identifier, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingParameter kind.

Source

pub fn unmatching_datatype( id: u32, scope: Identifier, called: Identifier, parameter: String, value: Value, expected: DescribedType, given: DescribedType, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnmatchingDataType kind.

Source

pub fn unset_parameter( id: u32, scope: Identifier, called: Identifier, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnsetParameter kind.

Source

pub fn multiple_parameter_assignation( id: u32, scope: Identifier, called: Identifier, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::MultipleParameterAssignation kind.

Source

pub fn no_value( id: u32, scope: Identifier, called: Identifier, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::NoValue kind.

Source

pub fn no_context( id: u32, scope: Identifier, model: Identifier, name: String, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::NoContext kind.

Source

pub fn unavailable_context( id: u32, scope: Identifier, context: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnavailableContext kind.

Source

pub fn connection_input_not_found( id: u32, scope: Identifier, to: Identifier, input: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConnectionInputNotFound kind.

Source

pub fn connection_self_input_not_found( id: u32, scope: Identifier, input: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConnectionSelfInputNotFound kind.

Source

pub fn connection_output_not_found( id: u32, scope: Identifier, from: Identifier, output: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConnectionOutputNotFound kind.

Source

pub fn connection_self_output_not_found( id: u32, scope: Identifier, output: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConnectionSelfOutputNotFound kind.

Source

pub fn unexisting_treatment( id: u32, scope: Identifier, claimed: IdentifierRequirement, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingTreatment kind.

Source

pub fn unexisting_model( id: u32, scope: Identifier, claimed: IdentifierRequirement, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingModel kind.

Source

pub fn unexisting_context( id: u32, scope: Identifier, claimed: IdentifierRequirement, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingContext kind.

Source

pub fn unexisting_function( id: u32, scope: Identifier, claimed: IdentifierRequirement, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingFunction kind.

Source

pub fn unexisting_data( id: u32, scope: Identifier, claimed: IdentifierRequirement, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingData kind.

Source

pub fn undeclared_model( id: u32, scope: Identifier, model: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UndeclaredModel kind.

Source

pub fn already_declared_model( id: u32, scope: Identifier, model: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::AlreadyDeclaredModel kind.

Source

pub fn undeclared_treatment( id: u32, scope: Identifier, treatment: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UndeclaredTreatment kind.

Source

pub fn already_declared_treatment( id: u32, scope: Identifier, treatment: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::AlreadyDeclaredTreatment kind.

Source

pub fn unexisting_connexion_type( id: u32, scope: Identifier, from: String, output: String, to: String, input: String, output_flow: Flow, output_type: DescribedType, input_flow: Flow, input_type: DescribedType, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingConnectionType kind.

Source

pub fn unsatisfied_output( id: u32, scope: Identifier, output: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnsatisfiedOutput kind.

Source

pub fn overloaded_output( id: u32, scope: Identifier, output: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::OverloadedOutput kind.

Source

pub fn unmatching_model_type( id: u32, scope: Identifier, called: Identifier, name: String, expected: Identifier, given_name: String, given: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnmatchingModelType kind.

Source

pub fn unexisting_parametric_model( id: u32, scope: Identifier, called: Identifier, parametric_model: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingParametricModel kind.

Source

pub fn unset_model( id: u32, scope: Identifier, called: Identifier, parametric_model: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnsetModel kind.

Source

pub fn already_included_build_step( id: u32, treatment: Identifier, cause_step: CheckStep, check_steps: Vec<CheckStep>, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::AlreadyIncludedBuildStep kind.

Source

pub fn unsatisfied_input( id: u32, scope: Option<Identifier>, treatment: String, input: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnsatisfiedInput kind.

Source

pub fn const_required_var_provided( id: u32, scope: Identifier, called: Identifier, parameter: String, variable: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConstRequiredVarProvided kind.

Source

pub fn const_required_context_provided( id: u32, scope: Identifier, called: Identifier, parameter: String, context: Identifier, entry: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConstRequiredContextProvided kind.

Source

pub fn model_instanciation_const_only( id: u32, scope: Identifier, called: Identifier, name: String, parameter: String, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ModelInstanciationConstOnly kind.

Source

pub fn const_required_function_returns_var( id: u32, scope: Identifier, called: Identifier, parameter: String, function: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::ConstRequiredFunctionReturnsVar kind.

Source

pub fn unmatching_number_of_parameters( id: u32, scope: Identifier, function: Identifier, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnmatchingNumberOfParameters kind.

Source

pub fn unexisting_generic( id: u32, scope: Identifier, element: Identifier, name: String, described_type: DescribedType, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnexistingGeneric kind.

Source

pub fn undefined_generic( id: u32, scope: Identifier, element: Identifier, described_type: DescribedType, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UndefinedGeneric kind.

Source

pub fn unsatisfied_traits( id: u32, scope: Identifier, element: Identifier, described_type: DescribedType, unsatisfied_traits: Vec<DataTrait>, design_reference: Option<Arc<dyn Reference>>, ) -> Self

Generates a new error with LogicErrorKind::UnsatisfiedTraits kind.

Trait Implementations§

Source§

impl Clone for LogicError

Source§

fn clone(&self) -> LogicError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogicError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for LogicError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<LogicError> for LogicErrors

Source§

fn from(value: LogicError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.