pub struct Operator { /* private fields */ }Expand description
Who asked, and what established it.
§Deserialization is a constructor, and it takes the same door
#[serde(try_from)] rather than a derived Deserialize, because a derive
reaches the private field directly and would admit the empty name
authenticated exists to refuse. This value arrives
from a store row and from a journal record far more often than from a
constructor call, and a blank actor read back out of either is an act on
record with nobody attached. A type that documents an invariant while
deriving Deserialize enforces it on the rare path and not on the ones an
attacker or a damaged row takes.
Implementations§
Source§impl Operator
impl Operator
Sourcepub fn authenticated(actor: impl Into<String>) -> Result<Self, OperatorError>
pub fn authenticated(actor: impl Into<String>) -> Result<Self, OperatorError>
An actor an authenticator named.
The caller is asserting that this name came from a verified credential rather than from anything the requester supplied. Nothing here can check that, which is why it is a named constructor: a reviewer reading a call site sees the claim being made.
§Errors
OperatorError when the name is empty or over MAX_LEN.
Sourcepub fn asserted(actor: impl Into<String>) -> Result<Self, OperatorError>
pub fn asserted(actor: impl Into<String>) -> Result<Self, OperatorError>
An actor somebody with the store typed.
§Errors
OperatorError when the name is empty or over MAX_LEN.
Sourcepub fn connected(actor: impl Into<String>) -> Result<Self, OperatorError>
pub fn connected(actor: impl Into<String>) -> Result<Self, OperatorError>
The party on an accepted connection, named by the channel it arrived on.
§Errors
OperatorError when the name is empty or over MAX_LEN.
Sourcepub fn from_parts(
actor: impl Into<String>,
basis: &str,
) -> Result<Self, OperatorError>
pub fn from_parts( actor: impl Into<String>, basis: &str, ) -> Result<Self, OperatorError>
Rebuild one from the two columns a store keeps.
The one place a stored pair becomes a value, so four backends’ decoders cannot drift on what an unknown basis means. Each caller frames the failure with its own table name; the rule itself lives here.
§Errors
OperatorError when the name is unusable or the basis is one this
build does not know.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operator
impl<'de> Deserialize<'de> for Operator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Operator
Source§impl JsonSchema for Operator
impl JsonSchema for Operator
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Operator
impl Ord for Operator
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Operator
impl PartialOrd for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnsafeUnpin for Operator
impl UnwindSafe for Operator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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