dope_runtime/client/
context.rs1use std::pin;
2
3use crate::client::Bound;
4
5pub struct Context<'borrow, 'app: 'borrow, 'd: 'app, P: ?Sized> {
10 provider: pin::Pin<&'borrow P>,
11 bound: Bound<'app, 'd, P>,
12}
13
14impl<'borrow, 'app: 'borrow, 'd: 'app, P: ?Sized> Context<'borrow, 'app, 'd, P> {
15 pub(crate) const fn new(provider: pin::Pin<&'borrow P>) -> Self {
16 Self {
17 provider,
18 bound: Bound::new(),
19 }
20 }
21
22 pub fn into_parts(self) -> (pin::Pin<&'borrow P>, Bound<'app, 'd, P>) {
23 (self.provider, self.bound)
24 }
25}
26
27const _: () = {
28 assert!(std::mem::size_of::<Context<'_, '_, '_, ()>>() == std::mem::size_of::<&()>());
29 assert!(!std::mem::needs_drop::<Context<'_, '_, '_, ()>>());
30};