Struct cedar_policy_core::ast::Extension
source · 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>,
) -> Self
pub fn new( name: Name, functions: impl IntoIterator<Item = ExtensionFunction>, ) -> 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>
Get an iterator over the function names
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