rust/proc-macro2/rcvec.rs
Source file repositories/reference/linux-study-clean/rust/proc-macro2/rcvec.rs
File Facts
- System
- Linux kernel
- Corpus path
rust/proc-macro2/rcvec.rs- Extension
.rs- Size
- 3114 bytes
- Lines
- 149
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function Somefunction pubfunction pubfunction pubfunction pubfunction next
Annotated Snippet
pub(crate) fn push(&mut self, element: T) {
self.inner.push(element);
}
pub(crate) fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
self.inner.extend(iter);
}
pub(crate) fn as_mut(&mut self) -> RcVecMut<T> {
RcVecMut {
inner: &mut self.inner,
}
}
pub(crate) fn build(self) -> RcVec<T> {
RcVec {
inner: Rc::new(self.inner),
}
}
}
impl<'a, T> RcVecMut<'a, T> {
pub(crate) fn push(&mut self, element: T) {
self.inner.push(element);
}
pub(crate) fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
self.inner.extend(iter);
}
pub(crate) fn as_mut(&mut self) -> RcVecMut<T> {
RcVecMut { inner: self.inner }
}
pub(crate) fn take(self) -> RcVecBuilder<T> {
let vec = mem::take(self.inner);
RcVecBuilder { inner: vec }
}
}
impl<T> Clone for RcVec<T> {
fn clone(&self) -> Self {
RcVec {
inner: Rc::clone(&self.inner),
}
}
}
impl<T> IntoIterator for RcVecBuilder<T> {
type Item = T;
type IntoIter = RcVecIntoIter<T>;
fn into_iter(self) -> Self::IntoIter {
RcVecIntoIter {
inner: self.inner.into_iter(),
}
}
}
impl<T> Iterator for RcVecIntoIter<T> {
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
self.inner.next()
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}
impl<T> RefUnwindSafe for RcVec<T> where T: RefUnwindSafe {}
Annotation
- Detected declarations: `function Some`, `function pub`, `function pub`, `function pub`, `function pub`, `function next`.
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.