diff options
Diffstat (limited to 'components/profile_traits/mem.rs')
-rw-r--r-- | components/profile_traits/mem.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/components/profile_traits/mem.rs b/components/profile_traits/mem.rs index f31e6f73358..4b4bd2a59f9 100644 --- a/components/profile_traits/mem.rs +++ b/components/profile_traits/mem.rs @@ -2,12 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +//! APIs for memory profiling. + +#![deny(missing_docs)] + use std::sync::mpsc::Sender; +/// Front-end representation of the profiler used to communicate with the +/// profiler. #[derive(Clone)] pub struct ProfilerChan(pub Sender<ProfilerMsg>); impl ProfilerChan { + /// Send `msg` on this `Sender`. + /// + /// Panics if the send fails. pub fn send(&self, msg: ProfilerMsg) { let ProfilerChan(ref c) = *self; c.send(msg).unwrap(); @@ -28,6 +37,9 @@ pub struct Report { pub struct ReportsChan(pub Sender<Vec<Report>>); impl ReportsChan { + /// Send `report` on this `Sender`. + /// + /// Panics if the send fails. pub fn send(&self, report: Vec<Report>) { let ReportsChan(ref c) = *self; c.send(report).unwrap(); |