Struct rsass::sass::Function[][src]

pub struct Function { /* fields omitted */ }

A function that can be called from a sass value.

The function can be either “builtin” (implemented in rust) or “user defined” (implemented in scss).

Implementations

impl Function[src]

pub fn get_builtin(name: &Name) -> Option<&'static Function>[src]

Get a built-in function by name.

pub fn builtin(
    module: &Name,
    name: &Name,
    args: FormalArgs,
    body: Arc<dyn Fn(&Scope) -> Result<Value, Error> + Send + Sync>
) -> Self
[src]

Create a new Function from a rust implementation.

Note: This does not expose the function in any scope, it just creates it.

pub fn closure(
    args: FormalArgs,
    pos: SourcePos,
    scope: ScopeRef,
    body: Vec<Item>
) -> Self
[src]

Create a new Function from a scss implementation.

The scope is where the function is defined, used to bind any non-parameter names in the body.

pub fn call(&self, callscope: ScopeRef, args: &CallArgs) -> Result<Value, Error>[src]

Call the function from a given scope and with a given set of arguments.

Trait Implementations

impl Clone for Function[src]

impl Debug for Function[src]

impl Eq for Function[src]

impl PartialEq<Function> for Function[src]

impl PartialOrd<Function> for Function[src]

impl StructuralEq for Function[src]

impl StructuralPartialEq for Function[src]

Auto Trait Implementations

impl !RefUnwindSafe for Function

impl Send for Function

impl Sync for Function

impl Unpin for Function

impl !UnwindSafe for Function

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,