pub struct Precompile {
pub program_id: Pubkey,
pub feature: Option<Pubkey>,
pub verify_fn: fn(&[u8], &[&[u8]], &FeatureSet) -> Result<(), PrecompileError>,
}Expand description
Information on a precompiled program
Fieldsยง
ยงprogram_id: PubkeyProgram id
feature: Option<Pubkey>Feature to enable on, None indicates always enabled
verify_fn: fn(&[u8], &[&[u8]], &FeatureSet) -> Result<(), PrecompileError>Verification function
Implementationsยง
Sourceยงimpl Precompile
impl Precompile
Sourcepub fn new(
program_id: Pubkey,
feature: Option<Pubkey>,
verify_fn: fn(&[u8], &[&[u8]], &FeatureSet) -> Result<(), PrecompileError>,
) -> Precompile
pub fn new( program_id: Pubkey, feature: Option<Pubkey>, verify_fn: fn(&[u8], &[&[u8]], &FeatureSet) -> Result<(), PrecompileError>, ) -> Precompile
Creates a new Precompile
Sourcepub fn check_id<F>(&self, program_id: &Pubkey, is_enabled: F) -> bool
pub fn check_id<F>(&self, program_id: &Pubkey, is_enabled: F) -> bool
Check if a program id is this precompiled program
Sourcepub fn verify(
&self,
data: &[u8],
instruction_datas: &[&[u8]],
feature_set: &FeatureSet,
) -> Result<(), PrecompileError>
pub fn verify( &self, data: &[u8], instruction_datas: &[&[u8]], feature_set: &FeatureSet, ) -> Result<(), PrecompileError>
Verify this precompiled program
Auto Trait Implementationsยง
impl Freeze for Precompile
impl RefUnwindSafe for Precompile
impl Send for Precompile
impl Sync for Precompile
impl Unpin for Precompile
impl UnwindSafe for Precompile
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> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Sourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Sourceยงfn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Sourceยงimpl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Sourceยงfn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.