Browse Source

doc(aya): Improve the description of `take_link` methods

Don't mix the tenses.
Michal Rostecki 3 months ago
parent
commit
85c73af1fe

+ 4 - 3
aya/src/programs/cgroup_device.rs

@@ -99,10 +99,11 @@ impl CgroupDevice {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupDeviceLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: CgroupDeviceLinkId,

+ 4 - 3
aya/src/programs/cgroup_skb.rs

@@ -125,10 +125,11 @@ impl CgroupSkb {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupSkbLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: CgroupSkbLinkId) -> Result<CgroupSkbLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/cgroup_sock.rs

@@ -103,10 +103,11 @@ impl CgroupSock {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupSockLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: CgroupSockLinkId) -> Result<CgroupSockLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/cgroup_sock_addr.rs

@@ -104,10 +104,11 @@ impl CgroupSockAddr {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupSockAddrLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: CgroupSockAddrLinkId,

+ 4 - 3
aya/src/programs/cgroup_sockopt.rs

@@ -103,10 +103,11 @@ impl CgroupSockopt {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupSockoptLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: CgroupSockoptLinkId,

+ 4 - 3
aya/src/programs/cgroup_sysctl.rs

@@ -98,10 +98,11 @@ impl CgroupSysctl {
         }
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`CgroupSysctlLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: CgroupSysctlLinkId,

+ 4 - 3
aya/src/programs/extension.rs

@@ -160,10 +160,11 @@ impl Extension {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`ExtensionLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: ExtensionLinkId) -> Result<ExtensionLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/fentry.rs

@@ -75,10 +75,11 @@ impl FEntry {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`FEntryLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: FEntryLinkId) -> Result<FEntryLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 3 - 3
aya/src/programs/fexit.rs

@@ -75,10 +75,10 @@ impl FExit {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned `FExitLink` is dropped, the link is detached.
     pub fn take_link(&mut self, link_id: FExitLinkId) -> Result<FExitLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/kprobe.rs

@@ -88,10 +88,11 @@ impl KProbe {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`KProbeLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: KProbeLinkId) -> Result<KProbeLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 3 - 3
aya/src/programs/lirc_mode2.rs

@@ -89,10 +89,10 @@ impl LircMode2 {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`LircLink`] is dropped, the link is detached.
     pub fn take_link(&mut self, link_id: LircLinkId) -> Result<LircLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 3 - 3
aya/src/programs/lsm.rs

@@ -81,10 +81,10 @@ impl Lsm {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`LsmLink`] is dropped, the link is detached.
     pub fn take_link(&mut self, link_id: LsmLinkId) -> Result<LsmLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/perf_event.rs

@@ -191,10 +191,11 @@ impl PerfEvent {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`PerfEventLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: PerfEventLinkId) -> Result<PerfEventLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/raw_trace_point.rs

@@ -60,10 +60,11 @@ impl RawTracePoint {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`RawTracePointLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: RawTracePointLinkId,

+ 4 - 3
aya/src/programs/sk_lookup.rs

@@ -82,10 +82,11 @@ impl SkLookup {
             .insert(SkLookupLink::new(FdLink::new(link_fd)))
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`SkLookupLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: SkLookupLinkId) -> Result<SkLookupLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/sk_msg.rs

@@ -97,10 +97,11 @@ impl SkMsg {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned  [`SkMsgLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: SkMsgLinkId) -> Result<SkMsgLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 3 - 3
aya/src/programs/sk_skb.rs

@@ -103,10 +103,10 @@ impl SkSkb {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`SkSkbLink`] is dropped, the link is detached.
     pub fn take_link(&mut self, link_id: SkSkbLinkId) -> Result<SkSkbLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/sock_ops.rs

@@ -100,10 +100,11 @@ impl SockOps {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`SockOpsLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: SockOpsLinkId) -> Result<SockOpsLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/socket_filter.rs

@@ -105,10 +105,11 @@ impl SocketFilter {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`SocketFilterLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: SocketFilterLinkId,

+ 4 - 3
aya/src/programs/tc.rs

@@ -322,10 +322,11 @@ impl SchedClassifier {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`SchedClassifierLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: SchedClassifierLinkId,

+ 4 - 3
aya/src/programs/tp_btf.rs

@@ -79,10 +79,11 @@ impl BtfTracePoint {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`BtfTracePointLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(
         &mut self,
         link_id: BtfTracePointLinkId,

+ 4 - 3
aya/src/programs/trace_point.rs

@@ -89,10 +89,11 @@ impl TracePoint {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`TracePointLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: TracePointLinkId) -> Result<TracePointLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 4 - 3
aya/src/programs/uprobe.rs

@@ -104,10 +104,11 @@ impl UProbe {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`UProbeLink`] is dropped, the link is
+    /// detached.
     pub fn take_link(&mut self, link_id: UProbeLinkId) -> Result<UProbeLink, ProgramError> {
         self.data.take_link(link_id)
     }

+ 3 - 3
aya/src/programs/xdp.rs

@@ -197,10 +197,10 @@ impl Xdp {
         self.data.links.remove(link_id)
     }
 
-    /// Takes ownership of the link referenced by the provided link_id.
+    /// Takes ownership of the link referenced by the provided `link_id`.
     ///
-    /// The link will be detached on `Drop` and the caller is now responsible
-    /// for managing its lifetime.
+    /// The caller takes the responsibility of managing the lifetime of the
+    /// link. When the returned [`XdpLink`] is dropped, the link is detached.
     pub fn take_link(&mut self, link_id: XdpLinkId) -> Result<XdpLink, ProgramError> {
         self.data.take_link(link_id)
     }