Struct nu_protocol::Overlay
source · [−]pub struct Overlay {
pub decls: IndexMap<Vec<u8>, DeclId>,
pub aliases: IndexMap<Vec<u8>, AliasId>,
pub env_vars: IndexMap<Vec<u8>, BlockId>,
pub span: Option<Span>,
}
Expand description
Collection of definitions that can be exported from a module
Fields
decls: IndexMap<Vec<u8>, DeclId>
aliases: IndexMap<Vec<u8>, AliasId>
env_vars: IndexMap<Vec<u8>, BlockId>
span: Option<Span>
Implementations
sourceimpl Overlay
impl Overlay
pub fn new() -> Self
pub fn from_span(span: Span) -> Self
pub fn add_decl(&mut self, name: &[u8], decl_id: DeclId) -> Option<DeclId>
pub fn add_alias(&mut self, name: &[u8], alias_id: AliasId) -> Option<AliasId>
pub fn add_env_var(&mut self, name: &[u8], block_id: BlockId) -> Option<BlockId>
pub fn extend(&mut self, other: &Overlay)
pub fn is_empty(&self) -> bool
pub fn get_decl_id(&self, name: &[u8]) -> Option<DeclId>
pub fn get_alias_id(&self, name: &[u8]) -> Option<AliasId>
pub fn has_decl(&self, name: &[u8]) -> bool
pub fn has_alias(&self, name: &[u8]) -> bool
pub fn decl_name_with_head(&self, name: &[u8], head: &[u8]) -> Option<Vec<u8>>
pub fn alias_name_with_head(&self, name: &[u8], head: &[u8]) -> Option<Vec<u8>>
pub fn decls_with_head(&self, head: &[u8]) -> Vec<(Vec<u8>, DeclId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn decl_names_with_head(&self, head: &[u8]) -> Vec<Vec<u8>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn aliases_with_head(&self, head: &[u8]) -> Vec<(Vec<u8>, AliasId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn alias_names_with_head(&self, head: &[u8]) -> Vec<Vec<u8>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn decls(&self) -> Vec<(Vec<u8>, DeclId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn decl_names(&self) -> Vec<Vec<u8>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn alias_names(&self) -> Vec<Vec<u8>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn aliases(&self) -> Vec<(Vec<u8>, AliasId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn get_env_var_id(&self, name: &[u8]) -> Option<BlockId>
pub fn has_env_var(&self, name: &[u8]) -> bool
pub fn env_var_with_head(
&self,
name: &[u8],
head: &[u8]
) -> Option<(Vec<u8>, BlockId)>
pub fn env_vars_with_head(&self, head: &[u8]) -> Vec<(Vec<u8>, BlockId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn env_vars(&self) -> Vec<(Vec<u8>, BlockId)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Overlay
impl Send for Overlay
impl Sync for Overlay
impl Unpin for Overlay
impl UnwindSafe for Overlay
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more