Struct solana_faucet::faucet::Faucet[][src]

pub struct Faucet {
    pub time_slice: Duration,
    // some fields omitted
}

Fields

time_slice: Duration

Implementations

impl Faucet[src]

pub fn new(
    faucet_keypair: Keypair,
    time_input: Option<u64>,
    per_time_cap: Option<u64>,
    per_request_cap: Option<u64>
) -> Self
[src]

pub fn new_with_allowed_ips(
    faucet_keypair: Keypair,
    time_input: Option<u64>,
    per_time_cap: Option<u64>,
    per_request_cap: Option<u64>,
    allowed_ips: HashSet<IpAddr>
) -> Self
[src]

pub fn check_time_request_limit<T: LimitByTime + Display>(
    &mut self,
    request_amount: u64,
    to: T
) -> Result<(), FaucetError>
[src]

pub fn clear_caches(&mut self)[src]

pub fn build_airdrop_transaction(
    &mut self,
    req: FaucetRequest,
    ip: IpAddr
) -> Result<FaucetTransaction, FaucetError>
[src]

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 the request exceeds this per-request limit, this method returns a signed SPL Memo transaction with the memo: “request too large; req: SOL cap: SOL”

pub fn process_faucet_request(
    &mut self,
    bytes: &[u8],
    ip: IpAddr
) -> Result<Vec<u8>, FaucetError>
[src]

Deserializes a received airdrop request, and returns a serialized transaction

Trait Implementations

impl Drop for Faucet[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Faucet

impl Send for Faucet

impl Sync for Faucet

impl Unpin for Faucet

impl UnwindSafe for Faucet

Blanket Implementations

impl<T> AbiExample for T

pub default fn example() -> T

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V