pub struct UserView {Show 20 fields
pub additional_fields: FieldMap,
pub visible_fields: Option<BTreeSet<String>>,
pub id: SchemaValue<String>,
pub name: SchemaValue<Option<String>>,
pub email: Option<String>,
pub email_verified: bool,
pub image: SchemaValue<Option<String>>,
pub created_at: FieldDate,
pub updated_at: FieldDate,
pub is_anonymous: Option<bool>,
pub phone_number: Option<String>,
pub phone_number_verified: Option<bool>,
pub username: Option<String>,
pub display_username: Option<String>,
pub two_factor_enabled: Option<bool>,
pub role: Option<String>,
pub banned: bool,
pub ban_reason: Option<String>,
pub ban_expires: Option<FieldDate>,
pub metadata: FieldValue,
}Expand description
Public user response shape.
Fields§
§additional_fields: FieldMapConfigured application fields after output transforms.
visible_fields: Option<BTreeSet<String>>Present optional core fields and enabled plugin fields. None preserves an unconfigured view.
id: SchemaValue<String>§name: SchemaValue<Option<String>>§email: Option<String>§email_verified: bool§image: SchemaValue<Option<String>>§created_at: FieldDate§updated_at: FieldDate§is_anonymous: Option<bool>§phone_number: Option<String>§phone_number_verified: Option<bool>§username: Option<String>§display_username: Option<String>§two_factor_enabled: Option<bool>§role: Option<String>§banned: bool§ban_reason: Option<String>§ban_expires: Option<FieldDate>§metadata: FieldValueImplementations§
Source§impl UserView
impl UserView
Sourcepub fn synthetic_output(
data: FieldMap,
config: &UserConfig,
metadata: &MetadataMap,
) -> AuthResult<FieldMap>
pub fn synthetic_output( data: FieldMap, config: &UserConfig, metadata: &MetadataMap, ) -> AuthResult<FieldMap>
Build an enumeration-safe signup response without adapter transforms or persistence.
Sourcepub async fn with_fields<T: AuthUser>(
user: &T,
config: &UserConfig,
metadata: &MetadataMap,
) -> AuthResult<Self>
pub async fn with_fields<T: AuthUser>( user: &T, config: &UserConfig, metadata: &MetadataMap, ) -> AuthResult<Self>
Construct the public user shape from the active application and plugin schemas. Application model serialization is inspected only at this user boundary.
pub async fn with_fields_for_adapter<T: AuthUser>( user: &T, config: &UserConfig, metadata: &MetadataMap, supports_native_json: bool, ) -> AuthResult<Self>
Sourcepub async fn with_field_policies<T: AuthUser>(
user: &T,
adapter: &UserConfig,
endpoint: &UserConfig,
metadata: &MetadataMap,
supports_native_json: bool,
) -> AuthResult<Self>
pub async fn with_field_policies<T: AuthUser>( user: &T, adapter: &UserConfig, endpoint: &UserConfig, metadata: &MetadataMap, supports_native_json: bool, ) -> AuthResult<Self>
Apply adapter transforms once, then use the endpoint’s field visibility.
Sourcepub async fn with_internal_fields<T: AuthUser>(
user: &T,
config: &UserConfig,
metadata: &MetadataMap,
) -> AuthResult<Self>
pub async fn with_internal_fields<T: AuthUser>( user: &T, config: &UserConfig, metadata: &MetadataMap, ) -> AuthResult<Self>
Apply adapter transforms and active schemas without removing application-only fields. Use this view only for trusted callbacks, never for public responses.
pub async fn with_internal_fields_for_adapter<T: AuthUser>( user: &T, config: &UserConfig, metadata: &MetadataMap, supports_native_json: bool, ) -> AuthResult<Self>
Sourcepub async fn with_internal_fields_many_for_adapter<T: AuthUser>(
users: &[T],
config: &UserConfig,
metadata: &MetadataMap,
supports_native_json: bool,
) -> AuthResult<Vec<Self>>
pub async fn with_internal_fields_many_for_adapter<T: AuthUser>( users: &[T], config: &UserConfig, metadata: &MetadataMap, 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_using<T: AuthUser>(
users: &[T],
config: &UserConfig,
metadata: &MetadataMap,
capabilities: FieldOutputCapabilities,
read_extra: impl Fn(&T, &str, &UserFieldConfig) -> AuthResult<Option<Value>> + Sync,
) -> AuthResult<Vec<Self>>
pub async fn with_internal_fields_many_for_adapter_using<T: AuthUser>( users: &[T], config: &UserConfig, metadata: &MetadataMap, capabilities: FieldOutputCapabilities, read_extra: impl Fn(&T, &str, &UserFieldConfig) -> AuthResult<Option<Value>> + Sync, ) -> AuthResult<Vec<Self>>
Project database rows with raw callback values for unprojected additional fields.
Some(Value::Null) preserves a present null; None retains the serialized source.
Supplied non-reference extras use the adapter capabilities after their output callback.
Native fields and completed adapter output do not use this accessor.
Source§impl UserView
impl UserView
Sourcepub fn from_model<T: AuthUser>(user: &T) -> AuthResult<Self>
pub fn from_model<T: AuthUser>(user: &T) -> AuthResult<Self>
Read an application model without applying adapter output transforms.
Trait Implementations§
Source§impl AuthRecordFields for UserView
impl AuthRecordFields for UserView
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>
Source§impl AuthUser for UserView
impl AuthUser for UserView
Source§const PLUGIN_FIELDS: &'static [&'static str]
const PLUGIN_FIELDS: &'static [&'static str]
Source§fn field_presence(&self) -> Option<&BTreeSet<String>>
fn field_presence(&self) -> Option<&BTreeSet<String>>
None.
A missing optional core field differs from a present field containing JSON null.Source§fn projected_fields(&self) -> Option<&FieldMap>
fn projected_fields(&self) -> Option<&FieldMap>
None so the output transform runs exactly once per database read.