pub struct ResourceTransformRequestHandle { /* private fields */ }Expand description
Owns one native handle.
A URL rewrite that a resource transform answers with the URL to load.
See mln_resource_transform_request in the
C API reference.
Implementations§
Source§impl ResourceTransformRequestHandle
impl ResourceTransformRequestHandle
Sourcepub fn complete(self, url: &str) -> Result<()>
pub fn complete(self, url: &str) -> Result<()>
Answers a resource transform request with the URL to load instead.
url must not be empty. A failed answer fails the request with
ResourceErrorReason::Other, as
ResourceTransformRequestHandle::release() does.
See mln_resource_transform_request_complete in the
C API reference.
Sourcepub fn fail(self, error: &ResourceTransformError<'_>) -> Result<()>
pub fn fail(self, error: &ResourceTransformError<'_>) -> Result<()>
Fails a resource transform request without sending it.
The library retries a request that failed for a reason it retries, such
as ResourceErrorReason::Connection, and the retry calls the transform
again. When this call fails, the request fails with
ResourceErrorReason::Other, as
ResourceTransformRequestHandle::release() does.
See mln_resource_transform_request_fail in the
C API reference.
Sourcepub fn release(self) -> Result<(), ReleaseError<Self>>
pub fn release(self) -> Result<(), ReleaseError<Self>>
Releases a resource transform request.
Releasing a request without an answer fails it with
ResourceErrorReason::Other.
See mln_resource_transform_request_release in the
C API reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceTransformRequestHandle
impl RefUnwindSafe for ResourceTransformRequestHandle
impl Send for ResourceTransformRequestHandle
impl Sync for ResourceTransformRequestHandle
impl Unpin for ResourceTransformRequestHandle
impl UnsafeUnpin for ResourceTransformRequestHandle
impl UnwindSafe for ResourceTransformRequestHandle
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more