Enum starlark::environment::LibraryExtension
source · pub enum LibraryExtension {
Show 14 variants
StructType,
RecordType,
EnumType,
Map,
Filter,
Partial,
Debug,
Print,
Pprint,
Breakpoint,
Json,
Typing,
Internal,
CallStack,
}
Expand description
The extra library definitions available in this Starlark implementation, but not in the standard.
Variants§
StructType
Definitions to support the struct
type, the struct()
constructor.
RecordType
Definitions to support the record
type, the record()
constructor and field()
function.
EnumType
Definitions to support the enum
type, the enum()
constructor.
Map
A function map(f, xs)
which applies f
to each element of xs
and returns the result.
Filter
A function filter(f, xs)
which applies f
to each element of xs
and returns those for which f
returns True
.
As a special case, filter(None, xs)
removes all None
values.
Partial
Partially apply a function, partial(f, *args, **kwargs)
will create a function where those args
kwargs
are already applied to f
.
Debug
Add a function debug(x)
which shows the Rust Debug
representation of a value.
Useful when debugging, but the output should not be considered stable.
Add a function print(x)
which prints to stderr.
Pprint
Add a function pprint(x)
which pretty-prints to stderr.
Breakpoint
Add a function breakpoint()
which will drop into a console-module evaluation prompt.
Json
Add a function json()
which will generate JSON for a module.
Typing
Provides typing.All
, typing.Callable
etc.
Usually used in conjunction with
Dialect::enable_types
.
Internal
Utilities exposing starlark-rust internals. These are not for production use.
CallStack
Add a function call_stack()
which returns a string representation of
the current call stack.
Implementations§
source§impl LibraryExtension
impl LibraryExtension
sourcepub fn add(self, builder: &mut GlobalsBuilder)
pub fn add(self, builder: &mut GlobalsBuilder)
Add a specific extension to a GlobalsBuilder
.
Trait Implementations§
source§impl Clone for LibraryExtension
impl Clone for LibraryExtension
source§fn clone(&self) -> LibraryExtension
fn clone(&self) -> LibraryExtension
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for LibraryExtension
impl PartialEq for LibraryExtension
source§fn eq(&self, other: &LibraryExtension) -> bool
fn eq(&self, other: &LibraryExtension) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for LibraryExtension
impl Eq for LibraryExtension
impl StructuralPartialEq for LibraryExtension
Auto Trait Implementations§
impl RefUnwindSafe for LibraryExtension
impl Send for LibraryExtension
impl Sync for LibraryExtension
impl Unpin for LibraryExtension
impl UnwindSafe for LibraryExtension
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.