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: FieldMapImplementations§
Source§impl SessionView
impl SessionView
Sourcepub fn filter_returned_fields(&mut self, config: &SessionConfig)
pub fn filter_returned_fields(&mut self, config: &SessionConfig)
Apply current public visibility without materializing absent cached fields.
Sourcepub async fn with_fields<T: AuthSession>(
session: &T,
config: &SessionConfig,
) -> AuthResult<Self>
pub async fn with_fields<T: AuthSession>( session: &T, config: &SessionConfig, ) -> AuthResult<Self>
Apply configured field visibility to a serialized application session model.
pub async fn with_fields_for_adapter<T: AuthSession>( session: &T, config: &SessionConfig, supports_native_json: bool, ) -> AuthResult<Self>
Sourcepub async fn with_internal_fields_for_adapter<T: AuthSession>(
session: &T,
config: &SessionConfig,
supports_native_json: bool,
) -> AuthResult<Self>
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.
Sourcepub async fn with_internal_fields_many_for_adapter<T: AuthSession>(
sessions: &[T],
config: &SessionConfig,
supports_native_json: bool,
) -> AuthResult<Vec<Self>>
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.
Sourcepub 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>>
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>>
Continue each projected session while other rows retain their pending field callbacks. Preserve the original row index for adapter-owned association data.
Sourcepub 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>>
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>>
Continue ready session projections together, retaining their original row indices.
Trait Implementations§
Source§impl AuthRecordFields for SessionView
impl AuthRecordFields for SessionView
fn field_values(&self) -> AuthResult<FieldMap>
Source§fn structured_clone(
&self,
context: &mut StructuredCloneContext,
) -> AuthResult<Self>
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
impl AuthSession for SessionView
Source§const PLUGIN_FIELDS: &'static [&'static str]
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>>
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>
fn projected_fields(&self) -> Option<&FieldMap>
Already projected fields from a cached session view.
fn id(&self) -> SchemaValue<Cow<'_, str>>
fn expires_at(&self) -> FieldDate
fn token(&self) -> &str
fn created_at(&self) -> FieldDate
fn updated_at(&self) -> FieldDate
fn ip_address(&self) -> Option<&str>
fn user_agent(&self) -> Option<&str>
fn user_id(&self) -> SchemaValue<Cow<'_, str>>
fn impersonated_by(&self) -> Option<&str>
Source§fn active_team_id(&self) -> Option<&str>
fn active_team_id(&self) -> Option<&str>
Active team selected for this session.
fn active_organization_id(&self) -> Option<&str>
fn active(&self) -> bool
Source§fn serialized_field_name(name: &str) -> &str
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<()>
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
impl Clone for SessionView
Source§impl Debug for SessionView
impl Debug for SessionView
Source§impl<'de> Deserialize<'de> for SessionView
impl<'de> Deserialize<'de> for SessionView
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
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
impl<T: AuthSession> From<&T> for SessionView
Source§impl From<SessionView> for FieldMap
impl From<SessionView> for FieldMap
Source§fn from(session: SessionView) -> Self
fn from(session: SessionView) -> Self
Converts to this type from the input type.
Source§impl FromFieldMap for SessionView
impl FromFieldMap for SessionView
fn from_field_values(fields: FieldMap) -> AuthResult<Self>
Source§impl PartialEq for SessionView
impl PartialEq for SessionView
Source§impl Serialize for SessionView
impl Serialize for SessionView
impl StructuralPartialEq for SessionView
Auto Trait Implementations§
impl Freeze for SessionView
impl RefUnwindSafe for SessionView
impl Send for SessionView
impl Sync for SessionView
impl Unpin for SessionView
impl UnsafeUnpin for SessionView
impl UnwindSafe for SessionView
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