pub struct Memory { /* private fields */ }Expand description
One current span for the whole process.
PHP: Utopia\Span\Storage\Memory, for FPM and CLI processes that handle
one request at a time.
use utopia_span::{Memory, Span, Storage};
let storage = Memory::new();
assert!(storage.get().is_none());
let span = Span::new("job");
storage.set(Some(span.clone()));
assert_eq!(storage.get(), Some(span));
storage.set(None);
assert!(storage.get().is_none());use Utopia\Span\Span;
use Utopia\Span\Storage\Memory;
$storage = new Memory();
var_dump($storage->get()); // NULL
$span = new Span('job');
$storage->set($span);
var_dump($storage->get() === $span); // bool(true)
$storage->set(null);
var_dump($storage->get()); // NULLImplementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Memory
impl Forget for Memory
impl Move for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more