pub enum GeneralContext<'c> {
Full(&'c Context<'c>),
NoDriver(&'c DriverlessContext<'c>),
}Expand description
Probably a Context, but might not be - there might be no driver
Definitely contains a DefinitionsContext.
Variants§
Full(&'c Context<'c>)
NoDriver(&'c DriverlessContext<'c>)
Implementations§
Source§impl<'c> GeneralContext<'c>
impl<'c> GeneralContext<'c>
pub fn full_ctx_raw( &self, ) -> Result<&Context<'c>, &'c (dyn Fn(Span) -> Error + 'c)>
Sourcepub fn full_ctx(
&self,
span: Span,
) -> Result<&'_ Context<'c>, MissingContextError<'c>>
pub fn full_ctx( &self, span: Span, ) -> Result<&'_ Context<'c>, MissingContextError<'c>>
Obtain a full Context, in situations where a driver is needed
Sourcepub fn defs(&self) -> &DefinitionsContext<'c>
pub fn defs(&self) -> &DefinitionsContext<'c>
Convenience method.
We could use .as_ref() but that is less clear (and risks
future inference failures).
We don’t bother with defs_mut.
pub fn error_loc(&self) -> Option<(Span, &'c str)>
pub fn prepend_error_loc( &self, rest: &[(Span, &'c str)], ) -> Vec<(Span, &'c str)>
pub fn clone_buf(&self) -> GeneralContextBuf<'c>
Source§impl<'c> GeneralContext<'c>
impl<'c> GeneralContext<'c>
pub fn display_for_dbg(&self) -> impl Display + '_
Source§impl<'c> GeneralContext<'c>
impl<'c> GeneralContext<'c>
pub fn find_definition<B>( &'c self, call: &'c DefinitionName, ) -> Result<Option<(&'c Definition<B>, GeneralContextBuf<'c>)>>
Trait Implementations§
Source§impl<'c> AsRef<DefinitionsContext<'c>> for GeneralContext<'c>
impl<'c> AsRef<DefinitionsContext<'c>> for GeneralContext<'c>
Source§fn as_ref(&self) -> &DefinitionsContext<'c>
fn as_ref(&self) -> &DefinitionsContext<'c>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'c> Clone for GeneralContext<'c>
impl<'c> Clone for GeneralContext<'c>
Source§fn clone(&self) -> GeneralContext<'c>
fn clone(&self) -> GeneralContext<'c>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'c> Copy for GeneralContext<'c>
Auto Trait Implementations§
impl<'c> Freeze for GeneralContext<'c>
impl<'c> !RefUnwindSafe for GeneralContext<'c>
impl<'c> !Send for GeneralContext<'c>
impl<'c> !Sync for GeneralContext<'c>
impl<'c> Unpin for GeneralContext<'c>
impl<'c> !UnwindSafe for GeneralContext<'c>
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