pub struct ActiveSubscription {
pub id: SubscriptionId,
pub subscription_name: String,
pub definition: SubscriptionDefinition,
pub user_context: Value,
pub variables: Value,
pub created_at: DateTime<Utc>,
pub connection_id: String,
pub rls_conditions: Vec<(String, Value)>,
}Expand description
A client’s active subscription.
Fields§
§id: SubscriptionIdUnique subscription ID.
subscription_name: StringSubscription type name from schema.
definition: SubscriptionDefinitionReference to subscription definition.
user_context: ValueUser context for authorization filtering.
variables: ValueRuntime variables provided by client.
created_at: DateTime<Utc>When the subscription was created.
connection_id: StringConnection/client identifier (for routing).
rls_conditions: Vec<(String, Value)>Row-level security conditions evaluated at subscribe time.
Each entry is (field_path, expected_value). An event is only delivered
when every condition matches the event data (AND semantics).
An empty list means no RLS filtering (admin or no RLS policy).
Implementations§
Source§impl ActiveSubscription
impl ActiveSubscription
Sourcepub fn new(
subscription_name: impl Into<String>,
definition: SubscriptionDefinition,
user_context: Value,
variables: Value,
connection_id: impl Into<String>,
) -> Self
pub fn new( subscription_name: impl Into<String>, definition: SubscriptionDefinition, user_context: Value, variables: Value, connection_id: impl Into<String>, ) -> Self
Create a new active subscription.
§Arguments
subscription_name- Schema subscription namedefinition- Subscription definition from compiled schemauser_context- Raw user context JSON fromWebSocketconnection_initvariables- Runtime variables from clientconnection_id- Client connection identifier
Sourcepub fn with_rls_conditions(self, conditions: Vec<(String, Value)>) -> Self
pub fn with_rls_conditions(self, conditions: Vec<(String, Value)>) -> Self
Set row-level security conditions for event filtering.
The caller evaluates the RLS policy against the user’s SecurityContext
at subscribe time and converts the resulting WhereClause into
(field, value) equality conditions. During event delivery,
matches_subscription checks every condition against the event data.
Trait Implementations§
Source§impl Clone for ActiveSubscription
impl Clone for ActiveSubscription
Source§fn clone(&self) -> ActiveSubscription
fn clone(&self) -> ActiveSubscription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ActiveSubscription
impl RefUnwindSafe for ActiveSubscription
impl Send for ActiveSubscription
impl Sync for ActiveSubscription
impl Unpin for ActiveSubscription
impl UnsafeUnpin for ActiveSubscription
impl UnwindSafe for ActiveSubscription
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more