pub fn capture() -> Option<Self> {
        let span = span::Span::current();

        if span.is_none() {
            None
        } else {
            let trace = Self { span };
            Some(trace)
        }
    }
/// Capture the current span trace.
///
/// # Examples
/// ```rust
/// use ark_relations::r1cs::ConstraintTrace;
///
/// pub struct MyError {
///     trace: Option<ConstraintTrace>,
///     // ...
/// }
///
/// # fn some_error_condition() -> bool { true }
///
/// pub fn my_function(arg: &str) -> Result<(), MyError> {
///     let _span = tracing::info_span!(target: "r1cs", "In my_function");
///     let _guard = _span.enter();
///     if some_error_condition() {
///         return Err(MyError {
///             trace: ConstraintTrace::capture(),
///             // ...
///         });
///     }
///
///     // ...
/// #   Ok(())
/// }
/// ```
Capture the current span trace.
Capture the current span trace .
pub fn capture() -> Option<Self> {
        let span = span::Span::current();
        if span.is_none() {
            None
        } else {
            let trace = Self { span };
            Some(trace)
        }
    }
pub fn capture ( ) -> Option < Self > { let span = span :: Span :: current ( ) ; if span . is_none ( ) { None } else { let trace = Self { span } ; Some ( trace ) } }
Capture the current span trace.
Capture the current span trace .
examples
```rust
use ark_relations::r1cs::ConstraintTrace.

pub struct MyError {
trace: Option,

}
` ` ` rust use ark_relations :: r1cs :: ConstraintTrace . pub struct MyError { trace : Option }
fn some_error_condition() -> bool { true }
pub fn my_function(arg: &str) -> Result<(), MyError> {
let _span = tracing::info_span!(target: "r1cs", "In my_function");
let _guard = _span.enter();
if some_error_condition() {
return Err(MyError {
trace: ConstraintTrace::capture(),

});
}


pub fn my_function ( arg : &str ) - > Result< () MyError > { let _span = tracing :: info_span! ( target : " r1cs " " In my_function " ) ; let _guard = _span . enter () ; if some_error_condition () { return Err ( MyError { trace : ConstraintTrace :: capture () } ) ; }
ok(())
None