pub struct AutoSession {
pub vehicle: VehicleId,
pub brand: BrandCaps,
pub transport: TransportPlacement,
pub grants: Vec<CapabilityName>,
}Expand description
Session state carried by automotive diagnostic fabrics.
Fields§
§vehicle: VehicleIdModeled vehicle identity.
brand: BrandCapsBrand or workshop capability profile.
transport: TransportPlacementPlacement that answers diagnostic requests.
grants: Vec<CapabilityName>Capabilities granted to this session before caller-side narrowing.
Implementations§
Source§impl AutoSession
impl AutoSession
Sourcepub fn new(
vehicle: VehicleId,
brand: BrandCaps,
transport: TransportPlacement,
grants: Vec<CapabilityName>,
) -> Self
pub fn new( vehicle: VehicleId, brand: BrandCaps, transport: TransportPlacement, grants: Vec<CapabilityName>, ) -> Self
Builds a session with explicit placement and grants.
Sourcepub fn modeled(
vehicle: VehicleId,
brand: BrandCaps,
grants: Vec<CapabilityName>,
) -> Self
pub fn modeled( vehicle: VehicleId, brand: BrandCaps, grants: Vec<CapabilityName>, ) -> Self
Builds a modeled session for a synthetic vehicle.
Sourcepub fn with_transport(self, transport: TransportPlacement) -> Self
pub fn with_transport(self, transport: TransportPlacement) -> Self
Returns a copy of this session with a different placement.
Sourcepub fn has_grant(&self, capability: &CapabilityName) -> bool
pub fn has_grant(&self, capability: &CapabilityName) -> bool
Returns whether the session holds capability before caller narrowing.
Sourcepub fn diminished_grants(&self, allowed: &[CapabilityName]) -> CapabilitySet
pub fn diminished_grants(&self, allowed: &[CapabilityName]) -> CapabilitySet
Intersects the session grants with caller-allowed capabilities.
Trait Implementations§
Source§impl Clone for AutoSession
impl Clone for AutoSession
Source§fn clone(&self) -> AutoSession
fn clone(&self) -> AutoSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutoSession
impl Debug for AutoSession
impl Eq for AutoSession
Source§impl PartialEq for AutoSession
impl PartialEq for AutoSession
impl StructuralPartialEq for AutoSession
Auto Trait Implementations§
impl Freeze for AutoSession
impl RefUnwindSafe for AutoSession
impl Send for AutoSession
impl Sync for AutoSession
impl Unpin for AutoSession
impl UnsafeUnpin for AutoSession
impl UnwindSafe for AutoSession
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