pub struct InstructionBuilder<'a> { /* private fields */ }Expand description
Fluent builder over a manifest + one instruction.
Implementations§
Source§impl<'a> InstructionBuilder<'a>
impl<'a> InstructionBuilder<'a>
Sourcepub fn new(
manifest: &'a ProgramManifest,
program_id: [u8; 32],
ix_name: &str,
) -> Result<Self, BuildError>
pub fn new( manifest: &'a ProgramManifest, program_id: [u8; 32], ix_name: &str, ) -> Result<Self, BuildError>
Locate ix_name in the manifest and return a builder seeded with the
instruction tag.
Sourcepub fn arg(self, bytes: &'a [u8]) -> Self
pub fn arg(self, bytes: &'a [u8]) -> Self
Add one arg’s raw bytes. Order must match the manifest.
Sourcepub fn account(self, pubkey: [u8; 32]) -> Self
pub fn account(self, pubkey: [u8; 32]) -> Self
Add one account pubkey. Order must match the manifest.
Sourcepub fn build(self) -> Result<BuiltInstruction, BuildError>
pub fn build(self) -> Result<BuiltInstruction, BuildError>
Finalize into a BuiltInstruction, validating shape.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for InstructionBuilder<'a>
impl<'a> RefUnwindSafe for InstructionBuilder<'a>
impl<'a> Send for InstructionBuilder<'a>
impl<'a> Sync for InstructionBuilder<'a>
impl<'a> Unpin for InstructionBuilder<'a>
impl<'a> UnsafeUnpin for InstructionBuilder<'a>
impl<'a> UnwindSafe for InstructionBuilder<'a>
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