pub struct Languages { /* private fields */ }Expand description
The nouns of the plugin contract that appear in the engine’s answers, so an interface needs nothing but this crate. The set of languages an engine knows about. Filled at startup; read-only after.
Implementations§
Source§impl LanguageRegistry
impl LanguageRegistry
pub fn new() -> LanguageRegistry
pub fn with(self, language: impl Language + 'static) -> LanguageRegistry
pub fn get(&self, id: &LanguageId) -> Option<Arc<dyn Language>>
pub fn for_path(&self, path: &Path) -> Option<Arc<dyn Language>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn Language>>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for LanguageRegistry
impl Clone for LanguageRegistry
Source§fn clone(&self) -> LanguageRegistry
fn clone(&self) -> LanguageRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LanguageRegistry
impl Debug for LanguageRegistry
Source§impl Default for LanguageRegistry
impl Default for LanguageRegistry
Source§fn default() -> LanguageRegistry
fn default() -> LanguageRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LanguageRegistry
impl !UnwindSafe for LanguageRegistry
impl Freeze for LanguageRegistry
impl Send for LanguageRegistry
impl Sync for LanguageRegistry
impl Unpin for LanguageRegistry
impl UnsafeUnpin for LanguageRegistry
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