pub struct StaticResourcePlugin {
pub code: StatusCode,
pub content_type: HeaderValue,
pub body: Bytes,
}Fields§
§code: StatusCode§content_type: HeaderValue§body: BytesTrait Implementations§
Source§impl Plugin for StaticResourcePlugin
impl Plugin for StaticResourcePlugin
Source§const CODE: &'static str = "static-resource"
const CODE: &'static str = "static-resource"
Plugin code, it should be unique repository-wise. Read more
Source§async fn call(
&self,
req: Request<SgBody>,
_inner: Inner,
) -> Result<Response<SgBody>, BoxError>
async fn call( &self, req: Request<SgBody>, _inner: Inner, ) -> Result<Response<SgBody>, BoxError>
This function will be called when the plugin is invoked. Read more
fn create(config: PluginConfig) -> Result<Self, BoxError>
fn meta() -> PluginMetaData
fn create_by_spec( spec: JsonValue, name: PluginInstanceName, ) -> Result<Self, BoxError>
Source§fn register(repo: &PluginRepository)
fn register(repo: &PluginRepository)
Register the plugin to the repository. Read more
Auto Trait Implementations§
impl !Freeze for StaticResourcePlugin
impl RefUnwindSafe for StaticResourcePlugin
impl Send for StaticResourcePlugin
impl Sync for StaticResourcePlugin
impl Unpin for StaticResourcePlugin
impl UnwindSafe for StaticResourcePlugin
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