pub struct MinimalAdapter { /* private fields */ }Expand description
A minimal custom adapter demonstrating basic trait implementation.
This example shows how to implement PhpSapiAdapter for a custom adapter
with simple configuration validation.
ⓘ
// Create and configure adapter
let adapter = MinimalAdapter::new()
.with_name("test-app")
.with_version("1.0.0");
// Build execution context (requires a valid PHP script)
let context = adapter.build(script_path)?;Implementations§
Trait Implementations§
Source§impl PhpSapiAdapter for MinimalAdapter
impl PhpSapiAdapter for MinimalAdapter
Source§fn build(
self,
script_path: impl AsRef<Path>,
) -> Result<ExecutionContext, AdapterError>
fn build( self, script_path: impl AsRef<Path>, ) -> Result<ExecutionContext, AdapterError>
Build an execution context from the configured adapter. Read more
Source§fn validate_script_path(
script_path: impl AsRef<Path>,
) -> Result<PathBuf, AdapterError>where
Self: Sized,
fn validate_script_path(
script_path: impl AsRef<Path>,
) -> Result<PathBuf, AdapterError>where
Self: Sized,
Validate that a script path exists and is accessible. Read more
Source§fn validate_non_empty(field_name: &str, value: &str) -> Result<(), AdapterError>where
Self: Sized,
fn validate_non_empty(field_name: &str, value: &str) -> Result<(), AdapterError>where
Self: Sized,
Validate a configuration field is not empty. Read more
Auto Trait Implementations§
impl Freeze for MinimalAdapter
impl RefUnwindSafe for MinimalAdapter
impl Send for MinimalAdapter
impl Sync for MinimalAdapter
impl Unpin for MinimalAdapter
impl UnwindSafe for MinimalAdapter
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