SessionUse

Enum SessionUse 

Source
pub enum SessionUse {
    None,
    Route,
    Identity {
        what: Vec<Arc<str>>,
    },
}
Expand description

What a view can observe about the Session it is handed.

Three verdicts rather than a boolean, because “reads the session” was one word for two facts and Mode B’s refusal only ever meant one of them.

Variants§

§

None

The view never touches its Session. §5.1’s Mode B class, and what signal_map produces.

§

Route

The view reads the route and nothing else. Eligible for Mode B: the browser chose the route and already holds the state, so a page that varies by it discloses nothing.

§

Identity

The view can observe who is asking — actor, claims, or the whole record. Refused Mode B.

Fields

§what: Vec<Arc<str>>

What was read, in the order a message should name it. "the session itself" when a Session reached somewhere this analysis cannot follow it into.

Implementations§

Source§

impl SessionUse

Source

pub fn reads_identity(&self) -> bool

Source

pub fn describe(&self) -> String

What the view reads, for a message and for beck explain render.

Source

pub fn of(view: &Core, defs: &BTreeMap<Arc<str>, Def>) -> SessionUse

Read the view’s code, and every definition it reaches, for what it does with a Session.

The rule is one sentence: a Session can only be observed by having a field read off it, so collect every field read whose base is Session-typed anywhere the view can reach. That is sound without tracking where the value flows, because flow does not create an observation — wherever the record ends up, reading it is still a Field over a Session-typed base, and every definition it could end up in is in this closure. What flow could hide is an observation that is not a field read: an equality, a digest, a session stored inside a value that crosses. Those are the escapes below, and they are the conservative answer rather than an ignored case.

Types make it cheap. A field read needs a concrete record type, so a Session passed through a generic definition cannot have anything read off it there — the parameter is a rigid variable and x.actor does not check. There is nowhere for a read to hide.

Trait Implementations§

Source§

impl Clone for SessionUse

Source§

fn clone(&self) -> SessionUse

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionUse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SessionUse

Source§

fn eq(&self, other: &SessionUse) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SessionUse

Source§

impl StructuralPartialEq for SessionUse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.