pub struct BuiltinProgram<C: ContextObject> { /* private fields */ }
Expand description
Represents the interface to a fixed functionality program
Implementations§
Source§impl<C: ContextObject> BuiltinProgram<C>
impl<C: ContextObject> BuiltinProgram<C>
Sourcepub fn new_loader(config: Config) -> Self
pub fn new_loader(config: Config) -> Self
Constructs a loader built-in program
Sourcepub fn new_builtin() -> Self
pub fn new_builtin() -> Self
Constructs a built-in program
Sourcepub fn get_config(&self) -> &Config
pub fn get_config(&self) -> &Config
Get the configuration settings assuming this is a loader program
Sourcepub fn get_function_registry(&self) -> &FunctionRegistry<BuiltinFunction<C>>
pub fn get_function_registry(&self) -> &FunctionRegistry<BuiltinFunction<C>>
Get the function registry depending on the SBPF version
Sourcepub fn register_function(
&mut self,
name: &str,
value: BuiltinFunction<C>,
) -> Result<(), ElfError>
pub fn register_function( &mut self, name: &str, value: BuiltinFunction<C>, ) -> Result<(), ElfError>
Register a function both in the sparse and dense registries
Trait Implementations§
Source§impl<C: ContextObject> Debug for BuiltinProgram<C>
impl<C: ContextObject> Debug for BuiltinProgram<C>
Source§impl<C: ContextObject> PartialEq for BuiltinProgram<C>
impl<C: ContextObject> PartialEq for BuiltinProgram<C>
impl<C: Eq + ContextObject> Eq for BuiltinProgram<C>
Auto Trait Implementations§
impl<C> Freeze for BuiltinProgram<C>
impl<C> RefUnwindSafe for BuiltinProgram<C>
impl<C> Send for BuiltinProgram<C>
impl<C> Sync for BuiltinProgram<C>
impl<C> Unpin for BuiltinProgram<C>
impl<C> UnwindSafe for BuiltinProgram<C>
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