pub struct Extension { /* private fields */ }Expand description
Cedar extension.
An extension can define new types and functions on those types. (Currently, there’s nothing preventing an extension from defining new functions on built-in types, either, although we haven’t discussed whether we want to allow this long-term.)
Implementations§
Source§impl Extension
impl Extension
Sourcepub fn new(
name: Name,
functions: impl IntoIterator<Item = ExtensionFunction>,
types_with_operator_overloading: impl IntoIterator<Item = Name>,
) -> Self
pub fn new( name: Name, functions: impl IntoIterator<Item = ExtensionFunction>, types_with_operator_overloading: impl IntoIterator<Item = Name>, ) -> Self
Create a new Extension with the given name and extension functions
Sourcepub fn get_func(&self, name: &Name) -> Option<&ExtensionFunction>
pub fn get_func(&self, name: &Name) -> Option<&ExtensionFunction>
Look up a function by name, or return None if the extension doesn’t
provide a function with that name
Sourcepub fn funcs(&self) -> impl Iterator<Item = &ExtensionFunction>
pub fn funcs(&self) -> impl Iterator<Item = &ExtensionFunction>
Iterate over the functions
Sourcepub fn ext_types(&self) -> impl Iterator<Item = &Name> + '_
pub fn ext_types(&self) -> impl Iterator<Item = &Name> + '_
Iterate over the extension types that can be produced by any functions in this extension
Sourcepub fn types_with_operator_overloading(
&self,
) -> impl Iterator<Item = &Name> + '_
pub fn types_with_operator_overloading( &self, ) -> impl Iterator<Item = &Name> + '_
Iterate over extension types with operator overloading
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Extension
impl !RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl !UnwindSafe for Extension
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> 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