pub struct HttpTool {
pub base: String,
pub allow: BTreeSet<(String, String)>,
pub max_body: usize,
pub max_request: usize,
pub calls: u64,
}Expand description
An HTTP endpoint restricted to an allowlist.
The allowlist is (METHOD, path) pairs. There is no redirect following, no
chunked encoding, and the body is bounded by max_body. A URL outside the
allowlist is rpc/tool-policy.
Fields§
§base: StringBase URL, e.g. http://127.0.0.1:8080.
allow: BTreeSet<(String, String)>Allowed (method, path) pairs.
max_body: usizeMaximum response bytes.
max_request: usizeMaximum request bytes.
calls: u64Calls served.
Implementations§
Trait Implementations§
Source§impl Provider for HttpTool
impl Provider for HttpTool
Source§fn mutating(&self, method: &str) -> bool
fn mutating(&self, method: &str) -> bool
Whether
method mutates provider state (refused on read-only caps).Source§fn invoke(&mut self, _object: u64, call: &Call) -> Result<Response>
fn invoke(&mut self, _object: u64, call: &Call) -> Result<Response>
Invoke a method on
object.Source§fn has_method(&self, method: &str) -> bool
fn has_method(&self, method: &str) -> bool
Whether this provider answers
method.Source§fn on_drop(&mut self, _object: u64, _cap: CapId)
fn on_drop(&mut self, _object: u64, _cap: CapId)
Called when the last capability referencing
object is dropped.Source§fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>
fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>
Drain provider-side drop notifications recorded by
Provider::on_drop. Read moreAuto Trait Implementations§
impl Freeze for HttpTool
impl RefUnwindSafe for HttpTool
impl Send for HttpTool
impl Sync for HttpTool
impl Unpin for HttpTool
impl UnsafeUnpin for HttpTool
impl UnwindSafe for HttpTool
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