Skip to main content

SessionView

Struct SessionView 

Source
pub struct SessionView {
Show 14 fields pub visible_fields: Option<BTreeSet<String>>, pub id: SchemaValue<String>, pub expires_at: FieldDate, pub token: String, pub created_at: FieldDate, pub updated_at: FieldDate, pub ip_address: Option<String>, pub user_agent: Option<String>, pub user_id: SchemaValue<String>, pub impersonated_by: Option<String>, pub active_organization_id: Option<String>, pub active_team_id: Option<String>, pub active: bool, pub additional_fields: FieldMap,
}
Expand description

Public session response shape.

Fields§

§visible_fields: Option<BTreeSet<String>>

Plugin field presence in the database projection or signed cache.

§id: SchemaValue<String>§expires_at: FieldDate§token: String§created_at: FieldDate§updated_at: FieldDate§ip_address: Option<String>§user_agent: Option<String>§user_id: SchemaValue<String>§impersonated_by: Option<String>§active_organization_id: Option<String>§active_team_id: Option<String>§active: bool§additional_fields: FieldMap

Implementations§

Source§

impl SessionView

Source

pub fn filter_returned_fields(&mut self, config: &SessionConfig)

Apply current public visibility without materializing absent cached fields.

Source

pub async fn with_fields<T: AuthSession>( session: &T, config: &SessionConfig, ) -> AuthResult<Self>

Apply configured field visibility to a serialized application session model.

Source

pub async fn with_fields_for_adapter<T: AuthSession>( session: &T, config: &SessionConfig, supports_native_json: bool, ) -> AuthResult<Self>

Source

pub async fn with_internal_fields_for_adapter<T: AuthSession>( session: &T, config: &SessionConfig, supports_native_json: bool, ) -> AuthResult<Self>

Include hidden application fields for trusted callbacks, never for public responses.

Source

pub async fn with_internal_fields_many_for_adapter<T: AuthSession>( sessions: &[T], config: &SessionConfig, supports_native_json: bool, ) -> AuthResult<Vec<Self>>

Project a database result in row order, interleaving synchronous callbacks by field.

Source

pub async fn with_internal_fields_many_for_adapter_then<T: AuthSession, R: Send, F>( sessions: &[T], config: &SessionConfig, supports_native_json: bool, complete: impl Fn(usize, Self) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<R>> + Send,

Continue each projected session while other rows retain their pending field callbacks. Preserve the original row index for adapter-owned association data.

Source

pub async fn with_internal_fields_many_for_adapter_batches_then<T: AuthSession, R: Send, F>( sessions: &[T], config: &SessionConfig, supports_native_json: bool, complete: impl Fn(Vec<(usize, Self)>) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<Vec<(usize, R)>>> + Send,

Continue ready session projections together, retaining their original row indices.

Trait Implementations§

Source§

impl AuthRecordFields for SessionView

Source§

fn field_values(&self) -> AuthResult<FieldMap>

Source§

fn structured_clone( &self, context: &mut StructuredCloneContext, ) -> AuthResult<Self>

Deep-copy runtime objects through one graph context while retaining record state.
Source§

impl AuthSession for SessionView

Source§

const PLUGIN_FIELDS: &'static [&'static str]

Plugin fields that the entity and store can read and persist. Read more
Source§

fn field_presence(&self) -> Option<&BTreeSet<String>>

Optional field presence for runtime records; database models expose every mapped column.
Source§

fn projected_fields(&self) -> Option<&FieldMap>

Already projected fields from a cached session view.
Source§

fn id(&self) -> SchemaValue<Cow<'_, str>>

Source§

fn expires_at(&self) -> FieldDate

Source§

fn token(&self) -> &str

Source§

fn created_at(&self) -> FieldDate

Source§

fn updated_at(&self) -> FieldDate

Source§

fn ip_address(&self) -> Option<&str>

Source§

fn user_agent(&self) -> Option<&str>

Source§

fn user_id(&self) -> SchemaValue<Cow<'_, str>>

Source§

fn impersonated_by(&self) -> Option<&str>

Source§

fn active_team_id(&self) -> Option<&str>

Active team selected for this session.
Source§

fn active_organization_id(&self) -> Option<&str>

Source§

fn active(&self) -> bool

Source§

fn serialized_field_name(name: &str) -> &str

Resolve an application field alias to the model’s serialized key.
Source§

fn require_plugin_fields(plugin: &str, required: &[&str]) -> AuthResult<()>

Reject a plugin whose required fields are absent from this entity.
Source§

impl Clone for SessionView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionView

Source§

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

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

impl<'de> Deserialize<'de> for SessionView

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: AuthSession> From<&T> for SessionView

Source§

fn from(session: &T) -> Self

Converts to this type from the input type.
Source§

impl From<SessionView> for FieldMap

Source§

fn from(session: SessionView) -> Self

Converts to this type from the input type.
Source§

impl FromFieldMap for SessionView

Source§

impl PartialEq for SessionView

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for SessionView

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SessionView

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more