Expand description
An owned smart pointer.
Fields
ptr: Box<T>Implementations
sourceimpl<T: 'static> P<T>
impl<T: 'static> P<T>
sourcepub fn and_then<U, F>(self, f: F) -> U where
F: FnOnce(T) -> U,
pub fn and_then<U, F>(self, f: F) -> U where
F: FnOnce(T) -> U,
Move out of the pointer.
Intended for chaining transformations not covered by map.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Equivalent to and_then(|x| x).
Trait Implementations
sourceimpl<T: AstLike + 'static> AstLike for P<T>
impl<T: AstLike + 'static> AstLike for P<T>
sourceconst SUPPORTS_CUSTOM_INNER_ATTRS: bool
const SUPPORTS_CUSTOM_INNER_ATTRS: bool
This is true if this AstLike might support ‘custom’ (proc-macro) inner
attributes. Attributes like #![cfg] and #![cfg_attr] are not
considered ‘custom’ attributes Read more
fn attrs(&self) -> &[Attribute]
fn visit_attrs(&mut self, f: impl FnOnce(&mut Vec<Attribute>))
fn tokens_mut(&mut self) -> Option<&mut Option<LazyTokenStream>>
sourceimpl<T: DummyAstNode + 'static> DummyAstNode for P<T>
impl<T: DummyAstNode + 'static> DummyAstNode for P<T>
sourceimpl<T> FromIterator<T> for P<[T]>
impl<T> FromIterator<T> for P<[T]>
sourceimpl<CTX, T> HashStable<CTX> for P<T> where
T: ?Sized + HashStable<CTX>,
impl<CTX, T> HashStable<CTX> for P<T> where
T: ?Sized + HashStable<CTX>,
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
sourceimpl<T> IntoIterator for P<[T]>
impl<T> IntoIterator for P<[T]>
sourceimpl<'a, T> IntoIterator for &'a P<[T]>
impl<'a, T> IntoIterator for &'a P<[T]>
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for P<T> where
T: RefUnwindSafe,
impl<T: ?Sized> Send for P<T> where
T: Send,
impl<T: ?Sized> Sync for P<T> where
T: Sync,
impl<T: ?Sized> Unpin for P<T>
impl<T: ?Sized> UnwindSafe for P<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.