Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rustecal-core/src/core_types/monitoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ impl From<i32> for TransportLayerType {
}
}

impl From<u32> for TransportLayerType {
fn from(value: u32) -> Self {
TransportLayerType::from(value as i32)
}
}

impl From<rustecal_sys::eCAL_Monitoring_STransportLayer> for TransportLayer {
fn from(raw: rustecal_sys::eCAL_Monitoring_STransportLayer) -> Self {
Self {
Expand Down
12 changes: 12 additions & 0 deletions rustecal-core/src/log_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,20 @@ impl From<i32> for LogLevel {
}
}

impl From<u32> for LogLevel {
fn from(value: u32) -> Self {
LogLevel::from(value as i32)
}
}

impl From<LogLevel> for i32 {
fn from(level: LogLevel) -> Self {
level as i32
}
}

impl From<LogLevel> for u32 {
fn from(level: LogLevel) -> Self {
level as u32
}
}
14 changes: 10 additions & 4 deletions rustecal-service/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ impl CallState {
impl From<i32> for CallState {
fn from(value: i32) -> Self {
match value {
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_none => CallState::None,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_executed => CallState::Executed,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_timeouted => CallState::Timeout,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_failed => CallState::Failed,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_none as i32 => CallState::None,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_executed as i32 => CallState::Executed,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_timeouted as i32 => CallState::Timeout,
x if x == rustecal_sys::eCAL_eCallState_eCAL_eCallState_failed as i32 => CallState::Failed,
other => CallState::Unknown(other),
}
}
}

impl From<u32> for CallState {
fn from(value: u32) -> Self {
CallState::from(value as i32)
}
}

#[derive(Debug, Clone, Copy)]
pub struct ServiceId {
pub service_id: eCAL_SEntityId,
Expand Down
Loading