[][src]Struct pinata_sdk::PinByHash

pub struct PinByHash { /* fields omitted */ }

Request object to pin hash of an already existing IPFS hash to pinata.

Example

let api = PinataApi::new("api_key", "secret_api_key").unwrap();
 
let result = api.pin_by_hash(PinByHash::new("hash")).await;
 
if let Ok(pinning_job) = result {
  // track result job here
}

Methods

impl PinByHash[src]

pub fn new<S>(hash: S) -> PinByHash where
    S: Into<String>, 
[src]

Create a new default PinByHash object with only the hash to pin set.

To set the pinata metadata and pinata options use the set_metadata() and set_options() chainable function to set those values.

pub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByHash[src]

Consumes the current PinByHash and returns a new PinByHash with keyvalues metadata set

pub fn set_metadata_with_name<S>(
    self,
    name: S,
    keyvalues: HashMap<String, MetadataValue>
) -> PinByHash where
    S: Into<String>, 
[src]

Consumes the current PinByHash and returns a new PinByHash with metadata name and keyvalues set

pub fn set_options(self, options: PinOptions) -> PinByHash[src]

Consumes the PinByHash and returns a new PinByHash with pinata options set.

Trait Implementations

impl Serialize for PinByHash[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.