[−][src]Struct pinata_sdk::PinByJson
Request object to pin json
Example
let api = PinataApi::new("api_key", "secret_api_key").unwrap(); let mut json_data = HashMap::new(); json_data.insert("name", "user"); let result = api.pin_json(PinByJson::new(json_data)).await; if let Ok(pinned_object) = result { let hash = pinned_object.ipfs_hash; }
Methods
impl<S> PinByJson<S> where
S: Serialize,
[src]
S: Serialize,
pub fn new(json_data: S) -> PinByJson<S>
[src]
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.
pub fn set_metadata(self, keyvalues: MetadataKeyValues) -> PinByJson<S>
[src]
Consumes the current PinByJson and returns a new PinByJson with keyvalues metadata set
pub fn set_metadata_with_name<IntoStr>(
self,
name: IntoStr,
keyvalues: MetadataKeyValues
) -> PinByJson<S> where
IntoStr: Into<String>,
[src]
self,
name: IntoStr,
keyvalues: MetadataKeyValues
) -> PinByJson<S> where
IntoStr: Into<String>,
Consumes the current PinByJson and returns a new PinByJson with keyvalues metadata set
pub fn set_options(self, options: PinOptions) -> PinByJson<S>
[src]
Consumes the PinByHash and returns a new PinByHash with pinata options set.
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for PinByJson<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for PinByJson<S> where
S: Send,
S: Send,
impl<S> Sync for PinByJson<S> where
S: Sync,
S: Sync,
impl<S> Unpin for PinByJson<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for PinByJson<S> where
S: UnwindSafe,
S: UnwindSafe,
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>,