pub struct PinByFile { /* private fields */ }Expand description
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;
}Implementations§
Source§impl PinByFile
impl PinByFile
Sourcepub fn new<S: Into<String>>(file_or_dir_path: S) -> PinByFile
pub fn new<S: Into<String>>(file_or_dir_path: S) -> PinByFile
Create a PinByFile object.
file_or_dir_path can be path to a file or to a directory.
If a directory is provided
Sourcepub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByFile
pub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByFile
Consumes the current PinByFile and returns a new PinByFile with keyvalues metadata set
Sourcepub fn set_metadata_with_name<IntoStr>(
self,
name: IntoStr,
keyvalues: MetadataKeyValues,
) -> PinByFile
pub fn set_metadata_with_name<IntoStr>( self, name: IntoStr, keyvalues: MetadataKeyValues, ) -> PinByFile
Consumes the current PinByFile and returns a new PinByFile with keyvalues metadata set
Sourcepub fn set_options(self, options: PinOptions) -> PinByFile
pub fn set_options(self, options: PinOptions) -> PinByFile
Consumes the PinByHash and returns a new PinByHash with pinata options set.
Auto Trait Implementations§
impl Freeze for PinByFile
impl RefUnwindSafe for PinByFile
impl Send for PinByFile
impl Sync for PinByFile
impl Unpin for PinByFile
impl UnwindSafe for PinByFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more