pub struct WorkContext {
pub api_base: String,
pub account_id: String,
pub organization_id: Option<String>,
}Expand description
Immutable authority on an agent/resource. This is a routing key, not a membership attestation. The token issuer validates each requested org.
Fields§
§api_base: String§account_id: String§organization_id: Option<String>Implementations§
Source§impl WorkContext
impl WorkContext
pub fn new( api_base: impl Into<String>, account_id: impl Into<String>, organization_id: Option<String>, ) -> Result<Self, String>
Sourcepub fn storage_key(&self, resource: &str) -> String
pub fn storage_key(&self, resource: &str) -> String
Stable filename-safe private resource key. Length framing prevents separator aliases; authority, account and organization all participate.
pub fn validate(&self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for WorkContext
impl Clone for WorkContext
Source§impl Debug for WorkContext
impl Debug for WorkContext
Source§impl<'de> Deserialize<'de> for WorkContext
impl<'de> Deserialize<'de> for WorkContext
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WorkContext
Source§impl JsonSchema for WorkContext
impl JsonSchema for WorkContext
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for WorkContext
impl Ord for WorkContext
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for WorkContext
impl PartialEq for WorkContext
Source§impl PartialOrd for WorkContext
impl PartialOrd for WorkContext
Source§impl Serialize for WorkContext
impl Serialize for WorkContext
impl StructuralPartialEq for WorkContext
Auto Trait Implementations§
impl Freeze for WorkContext
impl RefUnwindSafe for WorkContext
impl Send for WorkContext
impl Sync for WorkContext
impl Unpin for WorkContext
impl UnsafeUnpin for WorkContext
impl UnwindSafe for WorkContext
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