Struct qiniu_upload_token::GotUploadPolicy
source · [−]pub struct GotUploadPolicy<'a>(_);
Expand description
获取的上传策略
该数据结构目前和上传策略相同,可以和上传策略相互转换,但之后可能会添加更多字段
Implementations
sourceimpl GotUploadPolicy<'_>
impl GotUploadPolicy<'_>
sourcepub fn upload_policy(&self) -> &UploadPolicy
pub fn upload_policy(&self) -> &UploadPolicy
获取上传策略
sourcepub fn upload_policy_mut(&mut self) -> &mut UploadPolicy
pub fn upload_policy_mut(&mut self) -> &mut UploadPolicy
获取上传策略的可变引用
sourcepub fn into_upload_policy(self) -> UploadPolicy
pub fn into_upload_policy(self) -> UploadPolicy
转换为上传策略
Methods from Deref<Target = UploadPolicy>
sourcepub fn use_prefixal_object_key(&self) -> bool
pub fn use_prefixal_object_key(&self) -> bool
是否是对象名称前缀约束
sourcepub fn is_insert_only(&self) -> bool
pub fn is_insert_only(&self) -> bool
是否仅允许新增对象,不允许覆盖对象
sourcepub fn mime_detection_enabled(&self) -> bool
pub fn mime_detection_enabled(&self) -> bool
是否启用 MIME 类型自动检测
sourcepub fn token_deadline(&self) -> Option<SystemTime>
pub fn token_deadline(&self) -> Option<SystemTime>
上传凭证过期时间
sourcepub fn return_url(&self) -> Option<&str>
pub fn return_url(&self) -> Option<&str>
Web 端文件上传成功后,浏览器执行 303 跳转的 URL
sourcepub fn return_body(&self) -> Option<&str>
pub fn return_body(&self) -> Option<&str>
上传成功后,自定义七牛云最终返回给上传端的数据
sourcepub fn callback_urls(&self) -> Option<Split<'_, char>>
pub fn callback_urls(&self) -> Option<Split<'_, char>>
上传成功后,七牛云向业务服务器发送 POST 请求的 URL 列表
sourcepub fn callback_host(&self) -> Option<&str>
pub fn callback_host(&self) -> Option<&str>
上传成功后,七牛云向业务服务器发送回调请求时的 Host
sourcepub fn callback_body_type(&self) -> Option<&str>
pub fn callback_body_type(&self) -> Option<&str>
上传成功后,七牛云向业务服务器发送回调请求时的 Content-Type
默认为 application/x-www-form-urlencoded
,也可设置为 application/json
sourcepub fn is_save_key_forced(&self) -> bool
pub fn is_save_key_forced(&self) -> bool
是否忽略客户端指定的对象名称,强制使用自定义对象名称进行文件命名
sourcepub fn file_size_limitation(&self) -> (Option<u64>, Option<u64>)
pub fn file_size_limitation(&self) -> (Option<u64>, Option<u64>)
限定上传文件尺寸的范围
返回的第一个元素为最小尺寸,第二个元素为最大尺寸,如果为 None
表示不限制,单位为字节
sourcepub fn mime_types(&self) -> Option<Split<'_, char>>
pub fn mime_types(&self) -> Option<Split<'_, char>>
限定用户上传的文件类型
指定本字段值,七牛服务器会侦测文件内容以判断 MIME 类型,再用判断值跟指定值进行匹配, 匹配成功则允许上传,匹配失败则返回 403 状态码
sourcepub fn object_lifetime(&self) -> Option<Duration>
pub fn object_lifetime(&self) -> Option<Duration>
对象生命周期
精确到天
sourcepub fn get(&self, key: impl JsonValueIndex) -> Option<&JsonValue>
pub fn get(&self, key: impl JsonValueIndex) -> Option<&JsonValue>
根据指定的上传策略字段获取相应的值
sourcepub fn keys(&self) -> JsonMapKeys<'_>
pub fn keys(&self) -> JsonMapKeys<'_>
获取上传策略的字段迭代器
sourcepub fn values(&self) -> JsonMapValues<'_>
pub fn values(&self) -> JsonMapValues<'_>
获取上传策略的字段值的迭代器
Trait Implementations
sourceimpl<'a> Clone for GotUploadPolicy<'a>
impl<'a> Clone for GotUploadPolicy<'a>
sourcefn clone(&self) -> GotUploadPolicy<'a>
fn clone(&self) -> GotUploadPolicy<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for GotUploadPolicy<'a>
impl<'a> Debug for GotUploadPolicy<'a>
sourceimpl Deref for GotUploadPolicy<'_>
impl Deref for GotUploadPolicy<'_>
type Target = UploadPolicy
type Target = UploadPolicy
The resulting type after dereferencing.
sourceimpl DerefMut for GotUploadPolicy<'_>
impl DerefMut for GotUploadPolicy<'_>
sourceimpl<'a> From<&'a UploadPolicy> for GotUploadPolicy<'a>
impl<'a> From<&'a UploadPolicy> for GotUploadPolicy<'a>
sourcefn from(policy: &'a UploadPolicy) -> Self
fn from(policy: &'a UploadPolicy) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<Cow<'a, UploadPolicy>> for GotUploadPolicy<'a>
impl<'a> From<Cow<'a, UploadPolicy>> for GotUploadPolicy<'a>
sourcefn from(policy: Cow<'a, UploadPolicy>) -> Self
fn from(policy: Cow<'a, UploadPolicy>) -> Self
Converts to this type from the input type.
sourceimpl From<GotUploadPolicy<'_>> for UploadPolicy
impl From<GotUploadPolicy<'_>> for UploadPolicy
sourcefn from(result: GotUploadPolicy<'_>) -> Self
fn from(result: GotUploadPolicy<'_>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<GotUploadPolicy<'a>> for Cow<'a, UploadPolicy>
impl<'a> From<GotUploadPolicy<'a>> for Cow<'a, UploadPolicy>
sourcefn from(result: GotUploadPolicy<'a>) -> Self
fn from(result: GotUploadPolicy<'a>) -> Self
Converts to this type from the input type.
sourceimpl From<UploadPolicy> for GotUploadPolicy<'_>
impl From<UploadPolicy> for GotUploadPolicy<'_>
sourcefn from(policy: UploadPolicy) -> Self
fn from(policy: UploadPolicy) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<'a> RefUnwindSafe for GotUploadPolicy<'a>
impl<'a> Send for GotUploadPolicy<'a>
impl<'a> Sync for GotUploadPolicy<'a>
impl<'a> Unpin for GotUploadPolicy<'a>
impl<'a> UnwindSafe for GotUploadPolicy<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
sourcefn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
sourcefn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows self
and passes that borrow into the pipe function. Read more
sourcefn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows self
and passes that borrow into the pipe function. Read more
sourcefn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.borrow()
into the pipe function. Read more
sourcefn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
sourcefn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.as_ref()
into the pipe function.
sourcefn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
sourceimpl<T> Tap for T
impl<T> Tap for T
sourcefn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B>
of a value. Read more
sourcefn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B>
of a value. Read more
sourcefn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R>
view of a value. Read more
sourcefn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R>
view of a value. Read more
sourcefn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target
of a value. Read more
sourcefn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target
of a value. Read more
sourcefn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap()
only in debug builds, and is erased in release builds.
sourcefn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more