pub struct PinByHash { /* private fields */ }Expand description
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
}Implementations§
Source§impl PinByHash
impl PinByHash
Sourcepub fn new<S>(hash: S) -> PinByHash
pub fn new<S>(hash: S) -> PinByHash
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.
Sourcepub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByHash
pub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByHash
Consumes the current PinByHash and returns a new PinByHash with keyvalues metadata set
Sourcepub fn set_metadata_with_name<S>(
self,
name: S,
keyvalues: HashMap<String, MetadataValue>,
) -> PinByHash
pub fn set_metadata_with_name<S>( self, name: S, keyvalues: HashMap<String, MetadataValue>, ) -> PinByHash
Consumes the current PinByHash and returns a new PinByHash with metadata name and keyvalues set
Sourcepub fn set_options(self, options: PinOptions) -> PinByHash
pub fn set_options(self, options: PinOptions) -> PinByHash
Consumes the PinByHash and returns a new PinByHash with pinata options set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PinByHash
impl RefUnwindSafe for PinByHash
impl Send for PinByHash
impl Sync for PinByHash
impl Unpin for PinByHash
impl UnwindSafe for PinByHash
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