doc: Fix documentation warnings and add some links (#29887)

This commit is contained in:
Illia Bobyr 2023-01-25 23:15:58 -08:00 committed by GitHub
parent c96b52eda4
commit 8fafbb0a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 19 deletions

View File

@ -173,7 +173,7 @@ impl Faucet {
/// Checks per-request and per-time-ip limits; if both pass, this method returns a signed /// Checks per-request and per-time-ip limits; if both pass, this method returns a signed
/// SystemProgram::Transfer transaction from the faucet keypair to the requested recipient. If /// SystemProgram::Transfer transaction from the faucet keypair to the requested recipient. If
/// the request exceeds this per-request limit, this method returns a signed SPL Memo /// the request exceeds this per-request limit, this method returns a signed SPL Memo
/// transaction with the memo: "request too large; req: <REQUEST> SOL cap: <CAP> SOL" /// transaction with the memo: `"request too large; req: <REQUEST> SOL cap: <CAP> SOL"`
pub fn build_airdrop_transaction( pub fn build_airdrop_transaction(
&mut self, &mut self,
req: FaucetRequest, req: FaucetRequest,

View File

@ -229,14 +229,14 @@ pub mod columns {
/// The shred data column /// The shred data column
/// ///
/// index type: (u64, u64) /// index type: (u64, u64)
/// value type: Vec<u8> /// value type: [`Vec<u8>`]
pub struct ShredData; pub struct ShredData;
#[derive(Debug)] #[derive(Debug)]
/// The shred erasure code column /// The shred erasure code column
/// ///
/// index type: (u64, u64) /// index type: (u64, u64)
/// value type: Vec<u8> /// value type: [`Vec<u8>`]
pub struct ShredCode; pub struct ShredCode;
#[derive(Debug)] #[derive(Debug)]

View File

@ -228,7 +228,8 @@ pub trait RemoteWallet<T> {
unimplemented!(); unimplemented!();
} }
/// Sign transaction data with wallet managing pubkey at derivation path m/44'/501'/<account>'/<change>'. /// Sign transaction data with wallet managing pubkey at derivation path
/// `m/44'/501'/<account>'/<change>'`.
fn sign_message( fn sign_message(
&self, &self,
derivation_path: &DerivationPath, derivation_path: &DerivationPath,
@ -237,7 +238,8 @@ pub trait RemoteWallet<T> {
unimplemented!(); unimplemented!();
} }
/// Sign off-chain message with wallet managing pubkey at derivation path m/44'/501'/<account>'/<change>'. /// Sign off-chain message with wallet managing pubkey at derivation path
/// `m/44'/501'/<account>'/<change>'`.
fn sign_offchain_message( fn sign_offchain_message(
&self, &self,
derivation_path: &DerivationPath, derivation_path: &DerivationPath,

View File

@ -1,5 +1,5 @@
//! Persistent accounts are stored in below path location: //! Persistent accounts are stored at this path location:
//! <path>/<pid>/data/ //! `<path>/<pid>/data/`
//! //!
//! The persistent store would allow for this mode of operation: //! The persistent store would allow for this mode of operation:
//! - Concurrent single thread append with many concurrent readers. //! - Concurrent single thread append with many concurrent readers.
@ -12,8 +12,8 @@
//! The only required in memory data structure with a write lock is the index, //! The only required in memory data structure with a write lock is the index,
//! which should be fast to update. //! which should be fast to update.
//! //!
//! AppendVec's only store accounts for single slots. To bootstrap the //! [`AppendVec`]'s only store accounts for single slots. To bootstrap the
//! index from a persistent store of AppendVec's, the entries include //! index from a persistent store of [`AppendVec`]'s, the entries include
//! a "write_version". A single global atomic `AccountsDb::write_version` //! a "write_version". A single global atomic `AccountsDb::write_version`
//! tracks the number of commits to the entire data store. So the latest //! tracks the number of commits to the entire data store. So the latest
//! commit for each slot entry would be indexed. //! commit for each slot entry would be indexed.

View File

@ -29,7 +29,7 @@ impl<'a> SortedStorages<'a> {
} }
} }
/// primary method of retrieving (Slot, Arc<AccountStorageEntry>) /// primary method of retrieving [`(Slot, Arc<AccountStorageEntry>)`]
pub fn iter_range<R>(&'a self, range: &R) -> SortedStoragesIter<'a> pub fn iter_range<R>(&'a self, range: &R) -> SortedStoragesIter<'a>
where where
R: RangeBounds<Slot>, R: RangeBounds<Slot>,
@ -70,9 +70,9 @@ impl<'a> SortedStorages<'a> {
Self::new_with_slots(source.iter().zip(slots.into_iter()), None, None) Self::new_with_slots(source.iter().zip(slots.into_iter()), None, None)
} }
/// create `SortedStorages` from 'source' iterator. /// create [`SortedStorages`] from `source` iterator.
/// 'source' contains a Arc<AccountStorageEntry> and its associated slot /// `source` contains a [`Arc<AccountStorageEntry>`] and its associated slot
/// 'source' does not have to be sorted in any way, but is assumed to not have duplicate slot #s /// `source` does not have to be sorted in any way, but is assumed to not have duplicate slot #s
pub fn new_with_slots( pub fn new_with_slots(
source: impl Iterator<Item = (&'a Arc<AccountStorageEntry>, Slot)> + Clone, source: impl Iterator<Item = (&'a Arc<AccountStorageEntry>, Slot)> + Clone,
// A slot used as a lower bound, but potentially smaller than the smallest slot in the given 'source' iterator // A slot used as a lower bound, but potentially smaller than the smallest slot in the given 'source' iterator

View File

@ -159,9 +159,9 @@ impl StakesCache {
} }
/// The generic type T is either Delegation or StakeAccount. /// The generic type T is either Delegation or StakeAccount.
/// Stake<Delegation> is equivalent to the old code and is used for backward /// [`Stakes<Delegation>`] is equivalent to the old code and is used for backward
/// compatibility in BankFieldsToDeserialize. /// compatibility in [`crate::bank::BankFieldsToDeserialize`].
/// But banks cache Stakes<StakeAccount> which includes the entire stake /// But banks cache [`Stakes<StakeAccount>`] which includes the entire stake
/// account and StakeState deserialized from the account. Doing so, will remove /// account and StakeState deserialized from the account. Doing so, will remove
/// the need to load the stake account from accounts-db when working with /// the need to load the stake account from accounts-db when working with
/// stake-delegations. /// stake-delegations.

View File

@ -70,7 +70,7 @@ impl Keypair {
/// Note that the `Clone` trait is intentionally unimplemented because making a /// Note that the `Clone` trait is intentionally unimplemented because making a
/// second copy of sensitive secret keys in memory is usually a bad idea. /// second copy of sensitive secret keys in memory is usually a bad idea.
/// ///
/// Only use this in tests or when strictly required. Consider using Arc<Keypair> /// Only use this in tests or when strictly required. Consider using [`std::sync::Arc<Keypair>`]
/// instead. /// instead.
pub fn insecure_clone(&self) -> Self { pub fn insecure_clone(&self) -> Self {
Self(ed25519_dalek::Keypair { Self(ed25519_dalek::Keypair {

View File

@ -790,7 +790,7 @@ impl<'a> BorrowedAccount<'a> {
/// Call this when you have an owned buffer and want to replace the account /// Call this when you have an owned buffer and want to replace the account
/// data with it. /// data with it.
/// ///
/// If you have a slice, use set_data_from_slice(). /// If you have a slice, use [`Self::set_data_from_slice()`].
#[cfg(not(target_os = "solana"))] #[cfg(not(target_os = "solana"))]
pub fn set_data(&mut self, data: Vec<u8>) -> Result<(), InstructionError> { pub fn set_data(&mut self, data: Vec<u8>) -> Result<(), InstructionError> {
self.can_data_be_resized(data.len())?; self.can_data_be_resized(data.len())?;
@ -807,7 +807,7 @@ impl<'a> BorrowedAccount<'a> {
/// Call this when you have a slice of data you do not own and want to /// Call this when you have a slice of data you do not own and want to
/// replace the account data with it. /// replace the account data with it.
/// ///
/// If you have an owned buffer (eg Vec<u8>), use set_data(). /// If you have an owned buffer (eg [`Vec<u8>`]), use [`Self::set_data()`].
#[cfg(not(target_os = "solana"))] #[cfg(not(target_os = "solana"))]
pub fn set_data_from_slice(&mut self, data: &[u8]) -> Result<(), InstructionError> { pub fn set_data_from_slice(&mut self, data: &[u8]) -> Result<(), InstructionError> {
self.can_data_be_resized(data.len())?; self.can_data_be_resized(data.len())?;