pub struct ViewIntent {
pub view_id: String,
pub scope: String,
pub role_key: String,
pub request_id: String,
}Expand description
A ring view intent injected into FU.Data for mediated view projection.
ViewIntent is to views what RingCommand is to commands: the
input envelope that starts a ring cycle. A view cycle produces
projected output in SU (shape governed by C3’s route and the
organ’s AROUND extension).
The envelope is shorter than RingCommand because views have no
free-form parameters at this layer — everything needed to select
data comes from view_id (resolved via the ViewRegistry in
soma-interface) and GUARD’s scope evaluation over scope +
role_key.
Fields§
§view_id: StringView identifier — e.g. organ.mirror, term.fu.data.tree,
ext.git.commit.viewer. Resolves through ViewRegistry.
scope: StringGUARD scope the requestor is asking under. CU uses this to decide which projection slice is visible.
role_key: StringRole key of the requestor (application-defined label).
CU uses this for authorization scope evaluation. Injected into
the Tree as view.requestor_role by convention.
request_id: StringRequest correlation ID for tracing. Generated by the web layer, carried through the cycle.
Implementations§
Source§impl ViewIntent
impl ViewIntent
Sourcepub fn new(
view_id: impl Into<String>,
scope: impl Into<String>,
role_key: impl Into<String>,
request_id: impl Into<String>,
) -> Self
pub fn new( view_id: impl Into<String>, scope: impl Into<String>, role_key: impl Into<String>, request_id: impl Into<String>, ) -> Self
Create a new view intent.
Sourcepub fn inject_into(&self, tree: &mut Tree)
pub fn inject_into(&self, tree: &mut Tree)
Inject this view intent into a Tree as view.* entries.
Sourcepub fn extract_from(tree: &Tree) -> Option<Self>
pub fn extract_from(tree: &Tree) -> Option<Self>
Extract a view intent from a Tree’s view.* entries.
Returns None if view.id is absent (not a view cycle).
Sourcepub fn is_view_intent(tree: &Tree) -> bool
pub fn is_view_intent(tree: &Tree) -> bool
Check if a Tree contains a view intent (has view.id).
Trait Implementations§
Source§impl Clone for ViewIntent
impl Clone for ViewIntent
Source§fn clone(&self) -> ViewIntent
fn clone(&self) -> ViewIntent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ViewIntent
impl Debug for ViewIntent
Source§impl<'de> Deserialize<'de> for ViewIntent
impl<'de> Deserialize<'de> for ViewIntent
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>,
Source§impl PartialEq for ViewIntent
impl PartialEq for ViewIntent
Source§fn eq(&self, other: &ViewIntent) -> bool
fn eq(&self, other: &ViewIntent) -> bool
self and other values to be equal, and is used by ==.