pub struct View {
pub generation: u64,
pub ctx: Arc<Context>,
}Expand description
One reading of the repository: which generation, and the context of it.
The pair is taken together because a memo keyed on the number and filled from the context must not mix two readings: taking the number first, then the context, lets a reload happen between them and files the new context under the old number, where the next request finds the previous generation and calls it current. That is the original defect in miniature, and it is why there is no way to ask for the two separately on the path that uses them.
let view: View = Live::pinned(ctx).view();
assert_eq!(view.generation, 0);
assert!(view.ctx.registry.len() > 0, "the context of that generation, not another");Fields§
§generation: u64Which generation of the repository this is.
ctx: Arc<Context>The context built from it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for View
impl !UnwindSafe for View
impl Freeze for View
impl Send for View
impl Sync for View
impl Unpin for View
impl UnsafeUnpin for View
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