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.

§

Print

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

source

pub fn add(self, builder: &mut GlobalsBuilder)

Add a specific extension to a GlobalsBuilder.

Trait Implementations§

source§

impl Clone for LibraryExtension

source§

fn clone(&self) -> LibraryExtension

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Dupe for LibraryExtension

source§

fn dupe(&self) -> Self

source§

impl PartialEq for LibraryExtension

source§

fn eq(&self, other: &LibraryExtension) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for LibraryExtension

source§

impl Eq for LibraryExtension

source§

impl StructuralPartialEq for LibraryExtension

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> 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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

source§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.