pub struct RemainingTyped<'a> { /* private fields */ }Expand description
Sequential typed parser for remaining accounts.
Implementations§
Source§impl<'a> RemainingTyped<'a>
impl<'a> RemainingTyped<'a>
Sourcepub fn remaining_len(&self) -> usize
pub fn remaining_len(&self) -> usize
Number of unconsumed remaining slots.
Sourcepub fn next_account(&mut self) -> Result<&'a AccountView<'a>, ProgramError>
pub fn next_account(&mut self) -> Result<&'a AccountView<'a>, ProgramError>
Consume and return the next raw account view.
Sourcepub fn next_unchecked(&mut self) -> Result<UncheckedAccount<'a>, ProgramError>
pub fn next_unchecked(&mut self) -> Result<UncheckedAccount<'a>, ProgramError>
Consume and return the next raw account view as an explicit unchecked role.
Sourcepub fn next_signer(&mut self) -> Result<Signer<'a>, ProgramError>
pub fn next_signer(&mut self) -> Result<Signer<'a>, ProgramError>
Consume and validate the next account as a signer.
Sourcepub fn next_external<T: ExternalZeroCopy>(
&mut self,
) -> Result<ExternalAccount<'a, T>, ProgramError>
pub fn next_external<T: ExternalZeroCopy>( &mut self, ) -> Result<ExternalAccount<'a, T>, ProgramError>
Consume and validate the next account as a known external layout.
Sourcepub fn no_duplicates(self) -> Result<Self, ProgramError>
pub fn no_duplicates(self) -> Result<Self, ProgramError>
Fluent duplicate-policy gate for typed remaining parsing.
Sourcepub fn take_group(
&mut self,
len: usize,
) -> Result<RemainingGroup<'a>, ProgramError>
pub fn take_group( &mut self, len: usize, ) -> Result<RemainingGroup<'a>, ProgramError>
Consume a fixed-size sequential group from the remaining tail.
Call Self::no_duplicates first when the whole tail must be globally
alias-free across several groups.
Sourcepub fn assert_no_duplicates(&self) -> ProgramResult
pub fn assert_no_duplicates(&self) -> ProgramResult
Verify every remaining slot is distinct from declared and sibling slots.
Sourcepub fn assert_sorted_by<K, F>(&self, key: F) -> ProgramResult
pub fn assert_sorted_by<K, F>(&self, key: F) -> ProgramResult
Verify all remaining accounts are sorted by a caller-supplied key.
Sourcepub fn assert_empty(&self) -> ProgramResult
pub fn assert_empty(&self) -> ProgramResult
Require the typed parser to have consumed the full tail.
Auto Trait Implementations§
impl<'a> !Send for RemainingTyped<'a>
impl<'a> !Sync for RemainingTyped<'a>
impl<'a> Freeze for RemainingTyped<'a>
impl<'a> RefUnwindSafe for RemainingTyped<'a>
impl<'a> Unpin for RemainingTyped<'a>
impl<'a> UnsafeUnpin for RemainingTyped<'a>
impl<'a> UnwindSafe for RemainingTyped<'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