pub struct FakeCamera { /* private fields */ }Expand description
Handle to a running fake GigE Vision camera.
The camera runs as background tokio tasks. Call stop or
drop the handle to shut down the camera.
Implementations§
Source§impl FakeCamera
impl FakeCamera
Sourcepub fn builder() -> FakeCameraBuilder
pub fn builder() -> FakeCameraBuilder
Create a new builder.
Sourcepub async fn start() -> Result<Self, Error>
pub async fn start() -> Result<Self, Error>
Start a fake camera with default settings on 127.0.0.1:3956.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
The local address the GVCP socket is bound to.
Sourcepub async fn stop(self)
pub async fn stop(self)
Stop the fake camera and wait for its background tasks to exit.
Awaiting the JoinHandles after abort() ensures the tokio tasks have
dropped their Arc<UdpSocket> clones and the GVCP port is actually
released before the call returns — otherwise a subsequent rebind on
the same port can hit EADDRINUSE.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FakeCamera
impl !RefUnwindSafe for FakeCamera
impl Send for FakeCamera
impl Sync for FakeCamera
impl Unpin for FakeCamera
impl UnsafeUnpin for FakeCamera
impl !UnwindSafe for FakeCamera
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