Struct pinata_sdk::PinByFile
source · [−]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
sourceimpl 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 where
IntoStr: Into<String>,
pub fn set_metadata_with_name<IntoStr>(
self,
name: IntoStr,
keyvalues: MetadataKeyValues
) -> PinByFile where
IntoStr: Into<String>,
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 RefUnwindSafe for PinByFile
impl Send for PinByFile
impl Sync for PinByFile
impl Unpin for PinByFile
impl UnwindSafe for PinByFile
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