pub struct FakeOrgContext;Expand description
Convenience shortcut for building a fake OrganizationContext.
Derives org_id from the first entry in principal.org_path (or generates
a fresh one) so the context is internally consistent.
§Quick start
use uuid::Uuid;
use api_bones_test::builders::{FakePrincipal, FakeOrgContext};
let p = FakePrincipal::user(Uuid::new_v4()).build();
let ctx = FakeOrgContext::for_principal(&p);
assert!(!ctx.org_id.to_string().is_empty());Implementations§
Source§impl FakeOrgContext
impl FakeOrgContext
pub fn for_principal(principal: &Principal) -> OrganizationContext
Auto Trait Implementations§
impl Freeze for FakeOrgContext
impl RefUnwindSafe for FakeOrgContext
impl Send for FakeOrgContext
impl Sync for FakeOrgContext
impl Unpin for FakeOrgContext
impl UnsafeUnpin for FakeOrgContext
impl UnwindSafe for FakeOrgContext
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