pub struct Server { /* private fields */ }Expand description
A server struct responsible for managing and sending NMT commands.
Implementations§
Source§impl Server
impl Server
Sourcepub fn set_command_period(&self, period: Duration, command: Option<NmtCommand>)
pub fn set_command_period(&self, period: Duration, command: Option<NmtCommand>)
Sets the period and command for sending NMT commands.
§Arguments
period- The period duration for sending the command.command- The optional NMT command to be sent.
§Examples
use oze_canopen::Server;
use std::time::Duration;
use oze_canopen::proto::nmt::{NmtCommand, NmtCommandSpecifier};
let server = Server::start(interface);
server.set_command_period(Duration::from_secs(1), Some(NmtCommand::new(NmtCommandSpecifier::StartRemoteNode, 0)));Sourcepub fn start(interface: CanOpenInterface) -> Server
pub fn start(interface: CanOpenInterface) -> Server
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more