Implement native AIS inventory reconciliation (#63)
All checks were successful
Native code generation / deterministic (push) Successful in 13m18s
Imaging and meshing gate / native (push) Successful in 4m12s
Native Rust workspace compile / compile (push) Successful in 4m12s

This commit is contained in:
2026-08-10 06:41:29 +00:00
parent 61d6721287
commit d5c318d280
16 changed files with 1896 additions and 161 deletions

View File

@@ -699,6 +699,31 @@ impl HttpCapsClient {
.await
}
/// Sends a capability request whose verb or headers are not covered by the
/// fixed public compatibility overloads (`AISv3` uses `COPY` and
/// `Destination`). The request still passes through all normal limits,
/// cancellation, rate limiting, and injected-handler recording.
pub(crate) async fn send_custom(
&self,
method: &str,
uri: Uri,
headers: std::collections::BTreeMap<String, String>,
content_type: Option<String>,
payload: Vec<u8>,
cancellation_token: CancellationToken,
) -> Result<(HttpResponse, Vec<u8>), Error> {
self.send_with_headers(
method,
uri,
headers,
content_type,
payload,
cancellation_token,
None,
)
.await
}
pub async fn get_request(
&self,
uri: Uri,
@@ -1026,6 +1051,28 @@ impl HttpCapsClient {
payload: Vec<u8>,
cancellation_token: CancellationToken,
progress: Option<Box<dyn IProgress<HttpCapsClientProgressReport>>>,
) -> Result<(HttpResponse, Vec<u8>), Error> {
self.send_with_headers(
method,
uri,
std::collections::BTreeMap::new(),
content_type,
payload,
cancellation_token,
progress,
)
.await
}
async fn send_with_headers(
&self,
method: &str,
uri: Uri,
headers: std::collections::BTreeMap<String, String>,
content_type: Option<String>,
payload: Vec<u8>,
cancellation_token: CancellationToken,
progress: Option<Box<dyn IProgress<HttpCapsClientProgressReport>>>,
) -> Result<(HttpResponse, Vec<u8>), Error> {
if self.0.disposed.load(Ordering::Acquire) {
return Err(Error::InvalidOperation);
@@ -1057,6 +1104,7 @@ impl HttpCapsClient {
handler,
method,
uri,
headers,
content_type,
payload,
cancellation_token,
@@ -1069,6 +1117,7 @@ impl HttpCapsClient {
client,
method,
parsed,
headers,
content_type,
payload,
cancellation_token,
@@ -1086,6 +1135,7 @@ impl HttpCapsClient {
handler: &HttpMessageHandler,
method: &str,
uri: Uri,
headers: std::collections::BTreeMap<String, String>,
content_type: Option<String>,
payload: Vec<u8>,
cancellation_token: CancellationToken,
@@ -1095,7 +1145,7 @@ impl HttpCapsClient {
let request = HttpRequest {
method: method.to_owned(),
uri,
headers: std::collections::BTreeMap::new(),
headers,
content_type,
body: payload,
};
@@ -1112,6 +1162,7 @@ impl HttpCapsClient {
client: &reqwest::Client,
method: &str,
uri: reqwest::Url,
headers: std::collections::BTreeMap<String, String>,
content_type: Option<String>,
payload: Vec<u8>,
cancellation_token: CancellationToken,
@@ -1119,6 +1170,9 @@ impl HttpCapsClient {
) -> Result<(HttpResponse, Vec<u8>), Error> {
let method = reqwest::Method::from_bytes(method.as_bytes()).map_err(|_| Error::Argument)?;
let mut request = client.request(method, uri);
for (name, value) in headers {
request = request.header(name, value);
}
if let Some(content_type) = content_type {
request = request.header(reqwest::header::CONTENT_TYPE, content_type);
}