Coverage Report

Created: 2026-06-28 08:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.102/src/ptr.rs
Line
Count
Source
1
use alloc::boxed::Box;
2
use core::marker::PhantomData;
3
use core::ptr::NonNull;
4
5
#[repr(transparent)]
6
pub struct Own<T>
7
where
8
    T: ?Sized,
9
{
10
    pub ptr: NonNull<T>,
11
}
12
13
unsafe impl<T> Send for Own<T> where T: ?Sized {}
14
15
unsafe impl<T> Sync for Own<T> where T: ?Sized {}
16
17
impl<T> Copy for Own<T> where T: ?Sized {}
18
19
impl<T> Clone for Own<T>
20
where
21
    T: ?Sized,
22
{
23
0
    fn clone(&self) -> Self {
24
0
        *self
25
0
    }
26
}
27
28
impl<T> Own<T>
29
where
30
    T: ?Sized,
31
{
32
0
    pub fn new(ptr: Box<T>) -> Self {
33
0
        Own {
34
0
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
0
        }
36
0
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::fmt::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<reqwest::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<url::parser::ParseError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<jiff::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_json::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::new
37
38
0
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
0
        Own {
40
0
            ptr: self.ptr.cast(),
41
0
        }
42
0
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<logforth_core::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<logforth_core::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::fmt::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::fmt::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<std::io::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::fmt::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<std::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<reqwest::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<reqwest::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<reqwest::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<url::parser::ParseError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<jiff::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_json::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<url::parser::ParseError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<jiff::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::uri::InvalidUri>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::status::InvalidStatusCode>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<serde_json::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::num::error::ParseIntError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<serde_core::de::value::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::name::InvalidHeaderName>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::value::ToStrError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::value::InvalidHeaderValue>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<std::io::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<quick_xml::errors::serialize::DeError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<quick_xml::errors::serialize::SeError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<tokio::runtime::task::error::JoinError>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<url::parser::ParseError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<jiff::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::uri::InvalidUri>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<serde_json::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<serde_core::de::value::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::value::ToStrError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<std::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<&str>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>
43
44
0
    pub unsafe fn boxed(self) -> Box<T> {
45
0
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
0
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<logforth_core::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::fmt::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<std::io::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::fmt::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<reqwest::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<reqwest::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<url::parser::ParseError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<jiff::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::uri::InvalidUri>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::status::InvalidStatusCode>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<serde_json::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::num::error::ParseIntError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<serde_core::de::value::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::name::InvalidHeaderName>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::value::ToStrError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<http::header::value::InvalidHeaderValue>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<std::io::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<quick_xml::errors::serialize::DeError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<quick_xml::errors::serialize::SeError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<tokio::runtime::task::error::JoinError>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<url::parser::ParseError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<jiff::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_json::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<std::io::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::string::String>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<&str>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::boxed
47
48
0
    pub fn by_ref(&self) -> Ref<T> {
49
0
        Ref {
50
0
            ptr: self.ptr,
51
0
            lifetime: PhantomData,
52
0
        }
53
0
    }
54
55
0
    pub fn by_mut(&mut self) -> Mut<T> {
56
0
        Mut {
57
0
            ptr: self.ptr,
58
0
            lifetime: PhantomData,
59
0
        }
60
0
    }
61
}
62
63
#[repr(transparent)]
64
pub struct Ref<'a, T>
65
where
66
    T: ?Sized,
67
{
68
    pub ptr: NonNull<T>,
69
    lifetime: PhantomData<&'a T>,
70
}
71
72
impl<'a, T> Copy for Ref<'a, T> where T: ?Sized {}
73
74
impl<'a, T> Clone for Ref<'a, T>
75
where
76
    T: ?Sized,
77
{
78
0
    fn clone(&self) -> Self {
79
0
        *self
80
0
    }
81
}
82
83
impl<'a, T> Ref<'a, T>
84
where
85
    T: ?Sized,
86
{
87
0
    pub fn new(ptr: &'a T) -> Self {
88
0
        Ref {
89
0
            ptr: NonNull::from(ptr),
90
0
            lifetime: PhantomData,
91
0
        }
92
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::fmt::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<reqwest::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<url::parser::ParseError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<jiff::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_json::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::new
93
94
0
    pub fn from_raw(ptr: NonNull<T>) -> Self {
95
0
        Ref {
96
0
            ptr,
97
0
            lifetime: PhantomData,
98
0
        }
99
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<logforth_core::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<core::fmt::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<std::io::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<reqwest::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<url::parser::ParseError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<jiff::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::uri::InvalidUri>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::status::InvalidStatusCode>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<serde_json::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<serde_core::de::value::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<core::num::error::ParseIntError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::name::InvalidHeaderName>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::value::ToStrError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::value::InvalidHeaderValue>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<std::io::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<quick_xml::errors::serialize::DeError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<quick_xml::errors::serialize::SeError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<tokio::runtime::task::error::JoinError>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::string::String>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<&str>>::from_raw
100
101
0
    pub fn cast<U: CastTo>(self) -> Ref<'a, U::Target> {
102
0
        Ref {
103
0
            ptr: self.ptr.cast(),
104
0
            lifetime: PhantomData,
105
0
        }
106
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<logforth_core::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<logforth_core::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::fmt::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::fmt::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<std::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<core::fmt::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<std::io::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<reqwest::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<reqwest::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<reqwest::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<url::parser::ParseError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<jiff::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_json::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<url::parser::ParseError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<jiff::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::uri::InvalidUri>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<serde_json::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<serde_core::de::value::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::value::ToStrError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<std::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>
Unexecuted instantiation: <anyhow::ptr::Ref<url::parser::ParseError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<jiff::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::uri::InvalidUri>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::status::InvalidStatusCode>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<serde_json::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<serde_core::de::value::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<core::num::error::ParseIntError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::name::InvalidHeaderName>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::value::ToStrError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<http::header::value::InvalidHeaderValue>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<std::io::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<quick_xml::errors::serialize::DeError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<quick_xml::errors::serialize::SeError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<tokio::runtime::task::error::JoinError>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<alloc::string::String>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<&str>>
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::string::String>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<&str>>::cast::<()>
107
108
0
    pub fn by_mut(self) -> Mut<'a, T> {
109
0
        Mut {
110
0
            ptr: self.ptr,
111
0
            lifetime: PhantomData,
112
0
        }
113
0
    }
114
115
0
    pub fn as_ptr(self) -> *const T {
116
0
        self.ptr.as_ptr().cast_const()
117
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<logforth_core::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::fmt::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<reqwest::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<url::parser::ParseError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<jiff::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::uri::InvalidUri>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::status::InvalidStatusCode>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_json::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<serde_core::de::value::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::num::error::ParseIntError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::name::InvalidHeaderName>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::ToStrError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<http::header::value::InvalidHeaderValue>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<std::io::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::DeError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<quick_xml::errors::serialize::SeError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<tokio::runtime::task::error::JoinError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<alloc::string::String>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<&str>>>::as_ptr
118
119
0
    pub unsafe fn deref(self) -> &'a T {
120
0
        unsafe { &*self.ptr.as_ptr() }
121
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::deref
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::deref
122
}
123
124
#[repr(transparent)]
125
pub struct Mut<'a, T>
126
where
127
    T: ?Sized,
128
{
129
    pub ptr: NonNull<T>,
130
    lifetime: PhantomData<&'a mut T>,
131
}
132
133
impl<'a, T> Copy for Mut<'a, T> where T: ?Sized {}
134
135
impl<'a, T> Clone for Mut<'a, T>
136
where
137
    T: ?Sized,
138
{
139
0
    fn clone(&self) -> Self {
140
0
        *self
141
0
    }
142
}
143
144
impl<'a, T> Mut<'a, T>
145
where
146
    T: ?Sized,
147
{
148
0
    pub fn cast<U: CastTo>(self) -> Mut<'a, U::Target> {
149
0
        Mut {
150
0
            ptr: self.ptr.cast(),
151
0
            lifetime: PhantomData,
152
0
        }
153
0
    }
154
155
0
    pub fn by_ref(self) -> Ref<'a, T> {
156
0
        Ref {
157
0
            ptr: self.ptr,
158
0
            lifetime: PhantomData,
159
0
        }
160
0
    }
161
162
0
    pub fn extend<'b>(self) -> Mut<'b, T> {
163
0
        Mut {
164
0
            ptr: self.ptr,
165
0
            lifetime: PhantomData,
166
0
        }
167
0
    }
168
169
0
    pub unsafe fn deref_mut(self) -> &'a mut T {
170
0
        unsafe { &mut *self.ptr.as_ptr() }
171
0
    }
172
}
173
174
impl<'a, T> Mut<'a, T> {
175
0
    pub unsafe fn read(self) -> T {
176
0
        unsafe { self.ptr.as_ptr().read() }
177
0
    }
178
}
179
180
// Force turbofish on all calls of `.cast::<U>()`.
181
pub trait CastTo {
182
    type Target;
183
}
184
185
impl<T> CastTo for T {
186
    type Target = T;
187
}