Skip to main content

ExtensionRegistry

Struct ExtensionRegistry 

Source
pub struct ExtensionRegistry { /* private fields */ }
Expand description

Registry for managing DSL extensions with conflict resolution

Implementations§

Source§

impl ExtensionRegistry

Source

pub fn new() -> ExtensionRegistry

Create a new empty extension registry

Source

pub fn register_grammar<T>(&mut self, extension: T) -> Result<(), ParseError>
where T: GrammarExtension + 'static,

Register a grammar extension with conflict detection

Source

pub fn register_parser<T>(&mut self, parser: T, parser_id: String)
where T: StatementParser + 'static,

Register a statement parser

Source

pub fn compose_grammar(&self, base_grammar: &str) -> String

Get all grammar rules from registered extensions

Source

pub fn find_parser(&self, rule_name: &str) -> Option<&dyn StatementParser>

Find parser for a given rule name

Source

pub fn can_handle(&self, rule_name: &str) -> bool

Check if a rule is handled by an extension

Source

pub fn has_extensions(&self) -> bool

Check if any extensions are registered

Source

pub fn grammar_extensions(&self) -> impl Iterator<Item = &dyn GrammarExtension>

Get all grammar extensions

Source

pub fn has_extension(&self, extension_id: &str) -> bool

Check if a specific extension is registered

Source

pub fn get_parser_for_rule(&self, rule_name: &str) -> Option<&str>

Get parser for a rule name

Source

pub fn get_statement_parser( &self, parser_id: &str, ) -> Option<&dyn StatementParser>

Get statement parser by ID

Source

pub fn statement_parser_count(&self) -> usize

Get the number of registered statement parsers.

Source

pub fn statement_rules(&self) -> Vec<&str>

Get the registered extension statement rules in stable order.

Source

pub fn add_dependency(&mut self, dependent: &str, required: &str)

Add dependency between extensions

Source

pub fn validate_dependencies(&self) -> Result<(), ParseError>

Validate all extension dependencies are satisfied

Source

pub fn get_conflicts(&self) -> &BTreeMap<String, Vec<String>>

Get all rule conflicts for debugging

Source

pub fn get_detailed_conflicts(&self) -> Vec<String>

Get detailed conflict information with resolution suggestions

Source

pub fn check_compatibility( &self, extension_ids: &[&str], ) -> Result<(), ParseError>

Check extension compatibility

Source

pub fn with_builtin_extensions() -> ExtensionRegistry

Create a registry with built-in extensions

Source

pub fn for_third_party() -> ExtensionRegistry

Create a minimal registry for 3rd party integration

Source

pub fn generate_docs(&self) -> String

Generate basic documentation for all registered extensions

Trait Implementations§

Source§

impl Debug for ExtensionRegistry

Source§

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

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

impl Default for ExtensionRegistry

Source§

fn default() -> ExtensionRegistry

Returns the “default value” for a type. Read more

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Endpoint for T
where T: Send,