pub struct Backend<S: VclBackend<T>, T: VclResponse> { /* private fields */ }Expand description
Fat wrapper around VCL_BACKEND.
It will handle almost all the necessary boilerplate needed to create a custom backend. Most importantly,
it destroys/unregisters the backend as part of it’s Drop implementation, and
will convert the C methods to something more idiomatic.
Once created, a Backend’s sole purpose is to exist as a C reference for the VCL. As a
result, you don’t want to drop it until after all the transfers are done. The most common way
is just to have the backend be part of a vmod object because the object won’t be dropped until
the VCL is discarded and that can only happen once all the backend fetches are done.
Implementations§
Source§impl<S: VclBackend<T>, T: VclResponse> Backend<S, T>
impl<S: VclBackend<T>, T: VclResponse> Backend<S, T>
Trait Implementations§
Source§impl<S: VclBackend<T>, T: VclResponse> AsRef<BackendRef> for Backend<S, T>
impl<S: VclBackend<T>, T: VclResponse> AsRef<BackendRef> for Backend<S, T>
Source§fn as_ref(&self) -> &BackendRef
fn as_ref(&self) -> &BackendRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<S: Debug + VclBackend<T>, T: Debug + VclResponse> Debug for Backend<S, T>
impl<S: Debug + VclBackend<T>, T: Debug + VclResponse> Debug for Backend<S, T>
Source§impl<S: VclBackend<T>, T: VclResponse> Drop for Backend<S, T>
impl<S: VclBackend<T>, T: VclResponse> Drop for Backend<S, T>
Auto Trait Implementations§
impl<S, T> !Send for Backend<S, T>
impl<S, T> !Sync for Backend<S, T>
impl<S, T> Freeze for Backend<S, T>
impl<S, T> RefUnwindSafe for Backend<S, T>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, T> Unpin for Backend<S, T>where
T: Unpin,
impl<S, T> UnsafeUnpin for Backend<S, T>
impl<S, T> UnwindSafe for Backend<S, T>where
T: UnwindSafe,
S: UnwindSafe,
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