#[derive(Clone)]
pub struct SparqlResponse {
pub status: u16,
pub content_type: Option<String>,
pub body: Vec<u8>,
}
impl std::fmt::Debug for SparqlResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let content_type = self.content_type.as_deref().map(|ct| {
let capped: String = ct.chars().take(200).collect();
if capped.len() < ct.len() {
format!("{capped}…")
} else {
capped
}
});
f.debug_struct("SparqlResponse")
.field("status", &self.status)
.field("content_type", &content_type)
.field("body", &format!("<{} bytes>", self.body.len()))
.finish()
}
}