pub struct GateRequest {
pub actor: ActorRef,
pub namespace: Namespace,
pub verb: String,
pub args: Value,
pub context: GateContext,
}Expand description
What the gate sees on every verb invocation.
The JSON projection of this struct is the input shape policies receive
(e.g. Rego’s input.actor, input.verb, input.args). The shape is a
public contract — changing field names is a breaking change.
Invariant: verb must be non-empty. actor is validated by ActorRef.
Enforced at construction and deserialization.
Fields§
§actor: ActorRef§namespace: Namespace§verb: String§args: Value§context: GateContextImplementations§
Source§impl GateRequest
impl GateRequest
Sourcepub fn try_new(
actor: ActorRef,
namespace: Namespace,
verb: impl Into<String>,
args: Value,
) -> Result<Self, GateValidationError>
pub fn try_new( actor: ActorRef, namespace: Namespace, verb: impl Into<String>, args: Value, ) -> Result<Self, GateValidationError>
Create a validated GateRequest. Returns Err if verb is empty.
Sourcepub fn new(
actor: ActorRef,
namespace: Namespace,
verb: impl Into<String>,
args: Value,
) -> Self
pub fn new( actor: ActorRef, namespace: Namespace, verb: impl Into<String>, args: Value, ) -> Self
Builds a GateRequest with default (empty) context. Panics if verb is empty.
Sourcepub fn with_context(self, context: GateContext) -> Self
pub fn with_context(self, context: GateContext) -> Self
Attaches a GateContext (session, timestamp, source) to this request.
Trait Implementations§
Source§impl Clone for GateRequest
impl Clone for GateRequest
Source§fn clone(&self) -> GateRequest
fn clone(&self) -> GateRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GateRequest
impl Debug for GateRequest
Source§impl<'de> Deserialize<'de> for GateRequest
impl<'de> Deserialize<'de> for GateRequest
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GateRequest
impl RefUnwindSafe for GateRequest
impl Send for GateRequest
impl Sync for GateRequest
impl Unpin for GateRequest
impl UnsafeUnpin for GateRequest
impl UnwindSafe for GateRequest
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