aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-05-01 12:25:09 +0200
committerMs2ger <ms2ger@gmail.com>2015-06-18 16:27:32 +0200
commit5e5be69b01a2c4060d2aafefa252fcefe2d946c5 (patch)
tree98c8399792d477e9c8fa8d98368503f3769d3e34 /components
parent7355bf1061a21114654c1e8abe1d752624200799 (diff)
downloadservo-5e5be69b01a2c4060d2aafefa252fcefe2d946c5.tar.gz
servo-5e5be69b01a2c4060d2aafefa252fcefe2d946c5.zip
Require documentation for the memory profiling module.
Diffstat (limited to 'components')
-rw-r--r--components/profile_traits/lib.rs4
-rw-r--r--components/profile_traits/mem.rs12
2 files changed, 16 insertions, 0 deletions
diff --git a/components/profile_traits/lib.rs b/components/profile_traits/lib.rs
index 25dbb0b4c5b..1a20a02c234 100644
--- a/components/profile_traits/lib.rs
+++ b/components/profile_traits/lib.rs
@@ -2,5 +2,9 @@
* 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/. */
+//! This module contains APIs for the `profile` crate used generically in the
+//! rest of Servo. These APIs are here instead of in `profile` so that these
+//! modules won't have to depend on `profile`.
+
pub mod mem;
pub mod time;
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();