pub enum SmartPtrPointsTo<T: 'static> {
Box(BoxPointsTo<T>),
Arc(ArcPointsTo<T>),
}Variants§
Box(BoxPointsTo<T>)
Arc(ArcPointsTo<T>)
Implementations§
Source§impl<T: 'static> SmartPtrPointsTo<T>
impl<T: 'static> SmartPtrPointsTo<T>
pub fn arrow_Box_0(self) -> BoxPointsTo<T>
pub fn arrow_Arc_0(self) -> ArcPointsTo<T>
Source§impl<T> SmartPtrPointsTo<T>
impl<T> SmartPtrPointsTo<T>
Sourcepub open spec fn ptr(self) -> *mut T
pub open spec fn ptr(self) -> *mut T
{
match self {
SmartPtrPointsTo::Box(b) => b.ptr(),
SmartPtrPointsTo::Arc(a) => a.ptr(),
}
}Sourcepub open spec fn is_init(self) -> bool
pub open spec fn is_init(self) -> bool
{
match self {
SmartPtrPointsTo::Box(b) => b.is_init(),
SmartPtrPointsTo::Arc(a) => a.is_init(),
}
}Sourcepub open spec fn is_uninit(self) -> bool
pub open spec fn is_uninit(self) -> bool
{
match self {
SmartPtrPointsTo::Box(b) => b.is_uninit(),
SmartPtrPointsTo::Arc(a) => a.is_uninit(),
}
}Sourcepub proof fn get_box_points_to(tracked self) -> tracked ret : BoxPointsTo<T>
pub proof fn get_box_points_to(tracked self) -> tracked ret : BoxPointsTo<T>
requires
self is Box,Sourcepub proof fn get_arc_points_to(tracked self) -> tracked ret : ArcPointsTo<T>
pub proof fn get_arc_points_to(tracked self) -> tracked ret : ArcPointsTo<T>
requires
self is Arc,Sourcepub proof fn new_box_points_to(tracked
points_to: PointsTo<T>,
tracked dealloc: Option<Dealloc>,
) -> tracked ret : SmartPtrPointsTo<T>
pub proof fn new_box_points_to(tracked points_to: PointsTo<T>, tracked dealloc: Option<Dealloc>, ) -> tracked ret : SmartPtrPointsTo<T>
requires
points_to.is_init(),match dealloc {
Some(dealloc) => (
&&& vstd::layout::size_of::<T>() > 0
&&& valid_layout(size_of::<T>(), dealloc.align() as usize)
&&& points_to.ptr().addr() == dealloc.addr()
&&& points_to.ptr()@.provenance == dealloc.provenance()
&&& dealloc.size() == vstd::layout::size_of::<T>()
&&& dealloc.align() == vstd::layout::align_of::<T>()
),
None => vstd::layout::size_of::<T>() == 0,
},ensuresret.inv(),ret is Box,Sourcepub proof fn new_arc_points_to(tracked points_to: &'static PointsTo<T>) -> tracked ret : SmartPtrPointsTo<T>
pub proof fn new_arc_points_to(tracked points_to: &'static PointsTo<T>) -> tracked ret : SmartPtrPointsTo<T>
requires
points_to.is_init(),points_to.ptr().addr() != 0,points_to.ptr().addr() as int % vstd::layout::align_of::<T>() as int == 0,ensuresret.inv(),ret is Arc,Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SmartPtrPointsTo<T>
impl<T> RefUnwindSafe for SmartPtrPointsTo<T>where
T: RefUnwindSafe,
impl<T> Send for SmartPtrPointsTo<T>
impl<T> Sync for SmartPtrPointsTo<T>where
T: Sync,
impl<T> Unpin for SmartPtrPointsTo<T>where
T: Unpin,
impl<T> UnwindSafe for SmartPtrPointsTo<T>where
T: UnwindSafe + RefUnwindSafe,
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