[−][src]Struct pinata_sdk::PinByFile
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]
self,
name: IntoStr,
keyvalues: MetadataKeyValues
) -> PinByFile where
IntoStr: Into<String>,
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
impl RefUnwindSafe for PinByFile
impl Send for PinByFile
impl Sync for PinByFile
impl Unpin for PinByFile
impl UnwindSafe for PinByFile
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,