From 1951dd60ff7110bda1b69bfb60065d3a116ebfee Mon Sep 17 00:00:00 2001 From: gennyble Date: Thu, 27 Mar 2025 11:50:53 -0500 Subject: add some getters --- smalldog/src/lib.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/smalldog/src/lib.rs b/smalldog/src/lib.rs index adfe9c1..e139d30 100644 --- a/smalldog/src/lib.rs +++ b/smalldog/src/lib.rs @@ -1,11 +1,5 @@ use core::ffi; -use std::{ - borrow::Cow, - ffi::{CStr, CString}, - ptr, - str::FromStr, - sync::Mutex, -}; +use std::{borrow::Cow, ffi::CStr, ptr, sync::Mutex}; #[repr(C)] pub struct ModuleRequest<'req> { @@ -51,6 +45,14 @@ impl<'req> Request<'req> { None } + + pub fn headers(&self) -> &[(Cow, Cow)] { + &self.headers + } + + pub fn body(&self) -> Option<&[u8]> { + self.body + } } #[repr(C)] -- cgit 1.4.1-3-g733a5