Struct pinata_sdk::PinByHash
source · [−]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
sourceimpl PinByHash
impl PinByHash
sourcepub fn new<S>(hash: S) -> PinByHash where
S: Into<String>,
pub fn new<S>(hash: S) -> PinByHash where
S: Into<String>,
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 where
S: Into<String>,
pub fn set_metadata_with_name<S>(
self,
name: S,
keyvalues: HashMap<String, MetadataValue>
) -> PinByHash where
S: Into<String>,
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 RefUnwindSafe for PinByHash
impl Send for PinByHash
impl Sync for PinByHash
impl Unpin for PinByHash
impl UnwindSafe for PinByHash
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more