[][src]Struct pinata_sdk::PinByFile

pub struct PinByFile { /* fields omitted */ }

Request object to pin a file

Example

let api = PinataApi::new("api_key", "secret_api_key").unwrap();
 
let result = api.pin_file(PinByFile::new("file_or_dir_path")).await;
 
if let Ok(pinned_object) = result {
  let hash = pinned_object.ipfs_hash;
}

Methods

impl PinByFile[src]

pub fn new<S: Into<String>>(file_or_dir_path: S) -> PinByFile[src]

Create a PinByFile object.

file_or_dir_path can be path to a file or to a directory. If a directory is provided

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

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

pub fn set_metadata_with_name<IntoStr>(
    self,
    name: IntoStr,
    keyvalues: MetadataKeyValues
) -> PinByFile where
    IntoStr: Into<String>, 
[src]

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

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

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

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.