pub struct SqlmapEngine { /* private fields */ }Expand description
Manages the sqlmapapi lifecycle and provides access to its REST API.
When the engine is dropped, the locally spawned daemon subprocess is killed automatically via RAII (best-effort).
Implementations§
Source§impl SqlmapEngine
impl SqlmapEngine
Sourcepub async fn new(
port: u16,
spawn_local: bool,
binary_path: Option<&str>,
) -> Result<Self, SqlmapError>
pub async fn new( port: u16, spawn_local: bool, binary_path: Option<&str>, ) -> Result<Self, SqlmapError>
Launches a local sqlmapapi daemon bound to 127.0.0.1.
§Arguments
port— TCP port for the daemon. Port0is not supported.spawn_local— If true, spawns a localsqlmapapisubprocess.binary_path— Override thesqlmapapibinary location.
§Errors
Returns SqlmapError::ProcessError if the daemon fails to spawn,
or SqlmapError::ApiError if it doesn’t become responsive within 5 seconds.
Sourcepub async fn with_config(
port: u16,
spawn_local: bool,
binary_path: Option<&str>,
request_timeout: Duration,
poll_interval: Duration,
) -> Result<Self, SqlmapError>
pub async fn with_config( port: u16, spawn_local: bool, binary_path: Option<&str>, request_timeout: Duration, poll_interval: Duration, ) -> Result<Self, SqlmapError>
Launches a daemon with custom HTTP timeout and polling interval.
§Arguments
request_timeout— HTTP request timeout for API calls.poll_interval— Interval between status polls inwait_for_completion.
Sourcepub async fn create_task(
&self,
options: &SqlmapOptions,
) -> Result<SqlmapTask<'_>, SqlmapError>
pub async fn create_task( &self, options: &SqlmapOptions, ) -> Result<SqlmapTask<'_>, SqlmapError>
Creates and configures a new scanning task, returning an RAII wrapper.
The task is automatically deleted from the daemon when dropped.
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if sqlmapapi is available on this system.
Tests that the sqlmapapi binary exists and is executable.
Does NOT fall back to python3 -c "import sqlmap" since that
doesn’t guarantee the REST API server is available.
Sourcepub fn is_available_at(binary_path: &str) -> bool
pub fn is_available_at(binary_path: &str) -> bool
Check if sqlmapapi is available, trying the provided binary path first.