Enum qiniu_http::OnHeaderCallback
source · pub enum OnHeaderCallback<'r> {
Boxed(Box<dyn Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r>),
Referenced(&'r (dyn Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r)),
}
Expand description
接受到响应 Header 回调
Variants§
Boxed(Box<dyn Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r>)
用 Box 包装的接受到响应 Header 回调
Referenced(&'r (dyn Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r))
接受到响应 Header 回调的引用
Implementations§
source§impl<'r> OnHeaderCallback<'r>
impl<'r> OnHeaderCallback<'r>
sourcepub fn new(
callback: impl Fn(&HeaderName, &HeaderValue) -> AnyResult<()> + Send + Sync + 'r
) -> Self
pub fn new( callback: impl Fn(&HeaderName, &HeaderValue) -> AnyResult<()> + Send + Sync + 'r ) -> Self
创建回调函数
sourcepub fn reference(
callback: &'r (dyn Fn(&HeaderName, &HeaderValue) -> AnyResult<()> + Send + Sync + 'r)
) -> Self
pub fn reference( callback: &'r (dyn Fn(&HeaderName, &HeaderValue) -> AnyResult<()> + Send + Sync + 'r) ) -> Self
创建回调函数的引用
Trait Implementations§
source§impl Debug for OnHeaderCallback<'_>
impl Debug for OnHeaderCallback<'_>
source§impl<'r> Deref for OnHeaderCallback<'r>
impl<'r> Deref for OnHeaderCallback<'r>
source§impl<'r, T: Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r> From<T> for OnHeaderCallback<'r>
impl<'r, T: Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r> From<T> for OnHeaderCallback<'r>
Auto Trait Implementations§
impl<'r> !RefUnwindSafe for OnHeaderCallback<'r>
impl<'r> Send for OnHeaderCallback<'r>
impl<'r> Sync for OnHeaderCallback<'r>
impl<'r> Unpin for OnHeaderCallback<'r>
impl<'r> !UnwindSafe for OnHeaderCallback<'r>
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