[−][src]Struct gperftools_static::profiler::Profiler
The Profiler
The Profiler
gives access to the gperftools library.
By storing the state of the profiler and limiting access
we make the FFI safer.
Methods
impl Profiler
[src]
pub fn state(&self) -> ProfilerState
[src]
Returns the profiler state
Examples
use gperftools::profiler::PROFILER; println!("{}", PROFILER.lock().unwrap().state());
pub fn start<T>(&mut self, fname: T) -> Result<(), Error> where
T: Into<Vec<u8>>,
[src]
T: Into<Vec<u8>>,
Start the profiler
Will begin sampling once this function has been called
and will not stop until the stop
function has been called.
This function takes as an argument a filename. The filename must be
both valid Utf8 and a valid CString
.
Failures
- The profiler is currently
Active
. fname
is not a validCString
.fname
is not valid Utf8.fname
is not a file.- The user does not have write access to the file.
- An internal failure from the gperftools library.
pub fn stop(&mut self) -> Result<(), Error>
[src]
Stop the profiler.
This will stop the profiler if it Active
and return
an error otherwise.
Failures
- The profiler is
NotActive
.
Trait Implementations
Auto Trait Implementations
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnwindSafe for Profiler
impl RefUnwindSafe for Profiler
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,