Lines Matching defs:from
7 //! underlying object when it reaches zero. It is also safe to use concurrently from multiple
10 //! It is different from the standard library's [`Arc`] in a few ways:
107 /// Coercion from `Arc<Example>` to `Arc<dyn MyTrait>`:
175 // pointer, since it originates from a previous call to `Arc::into_raw` on an `Arc` that is
185 // This is to allow coercion from `Arc<T>` to `Arc<U>` if `T` can be converted to the
246 /// Constructs a new [`Arc`] from an existing [`ArcInner`].
286 // SAFETY: The caller promises that this pointer originates from a call to `into_raw` on an
290 // SAFETY: By the safety requirements we know that `ptr` came from `Arc::into_raw`, so the
295 /// Returns an [`ArcBorrow`] from the given [`Arc`].
361 Some(Pin::from(UniqueArc {
383 // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous
387 // SAFETY: By the safety requirement of this function, we know that `ptr` came from
394 // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous
441 /// // Borrowed from `i`.
472 // SAFETY: The pointer was initialised from the result of `KBox::leak`.
479 fn from(item: UniqueArc<T>) -> Self {
485 fn from(item: Pin<UniqueArc<T>>) -> Self {
494 /// to use just `&T`, which we can trivially get from an [`Arc<T>`] instance.
590 /// * The provided pointer must originate from a call to [`Arc::into_raw`] or [`Arc::as_ptr`].
596 // SAFETY: The caller promises that this pointer originates from a call to `into_raw` on an
608 fn from(b: ArcBorrow<'_, T>) -> Self {
694 /// let mut pinned = Pin::from(UniqueArc::new(Example { a: 10, b: 20 }, GFP_KERNEL)?);
769 // SAFETY: The pointer from the `KBox` is valid.
792 // SAFETY: The new `Arc` is taking over `ptr` from `self.inner` (which won't be
824 fn from(obj: UniqueArc<T>) -> Self {
863 /// // Borrowed from `i`.
888 /// // Borrowed from `i`.