pub struct PinSpec {
pub cid: Option<String>,
pub bytes: ByteUnit<DefaultFactorOne>,
pub time: TimeUnit,
pub redundancy: i64,
pub fallback_urls: Option<Vec<String>>,
}
Expand description
Specification for a Pin resource
Defines the key parameters for pinning data including size, duration and redundancy. Either a CID or fallback URLs must be specified.
§Examples
use crate::models::PinSpec;
let spec = PinSpec {
cid: Some("QmExample123".to_string()),
bytes: "1GB".parse().unwrap(),
time: "24h".parse().unwrap(),
redundancy: 3,
fallback_urls: None,
};
Fields§
§cid: Option<String>
§bytes: ByteUnit<DefaultFactorOne>
§time: TimeUnit
§redundancy: i64
§fallback_urls: Option<Vec<String>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PinSpec
impl<'de> Deserialize<'de> for PinSpec
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PinSpec
impl RefUnwindSafe for PinSpec
impl Send for PinSpec
impl Sync for PinSpec
impl Unpin for PinSpec
impl UnwindSafe for PinSpec
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request