Skip to main content

DVRIPCam

Struct DVRIPCam 

Source
pub struct DVRIPCam { /* private fields */ }

Implementations§

Source§

impl DVRIPCam

Source

pub fn new(ip: impl Into<String>) -> Self

Examples found in repository?
examples/device_upgrade.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    cam.connect(Duration::from_secs(5)).await?;
19    cam.login(user, pass).await?;
20
21    println!("Checking device upgrade compatibility...");
22    match cam.get_upgrade_info().await {
23        Ok(info) => println!("Upgrade Information: {:#?}", info),
24        Err(e) => eprintln!("Failed to get upgrade info: {}", e),
25    }
26
27    println!("\n--- FIRMWARE UPGRADE EXAMPLE ---");
28    println!("WARNING: This is a critical operation. Ensure you have the correct .bin file.");
29
30    cam.close().await?;
31    Ok(())
32}
More examples
Hide additional examples
examples/alarm_remote_control.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    cam.connect(Duration::from_secs(5)).await?;
19    cam.login(user, pass).await?;
20
21    println!("Attempting to trigger the device's remote alarm/siren output...");
22
23    match cam.set_remote_alarm(true).await {
24        Ok(true) => println!("Alarm activated! Check your device."),
25        Ok(false) => println!("Command sent but device returned failure."),
26        Err(e) => eprintln!("Error sending command: {}", e),
27    }
28
29    println!("Waiting 5 seconds before deactivating...");
30    tokio::time::sleep(Duration::from_secs(5)).await;
31
32    println!("Deactivating alarm...");
33    let _ = cam.set_remote_alarm(false).await;
34
35    cam.close().await?;
36    println!("Done.");
37
38    Ok(())
39}
examples/alarm_event_logging.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    println!("Connecting and logging in...");
19    cam.connect(Duration::from_secs(5)).await?;
20
21    if !cam.login(user, pass).await? {
22        println!("Login failed");
23        return Ok(());
24    }
25
26    println!("Starting alarm monitoring...");
27
28    let callback = Box::new(|data: serde_json::Value, count| {
29        let now = chrono::Local::now();
30        println!("\n[{}] EVENT #{}", now.format("%H:%M:%S"), count);
31
32        if let Some(obj) = data.as_object() {
33            for (key, value) in obj {
34                println!("  {}: {}", key, value);
35            }
36        } else {
37            println!("  Raw Data: {}", data);
38        }
39    });
40
41    cam.set_alarm_callback(Some(callback));
42    cam.start_alarm_monitoring().await?;
43
44    println!("Monitoring for 2 minutes. Press Ctrl+C to stop early.");
45    tokio::time::sleep(Duration::from_secs(120)).await;
46
47    println!("Stopping monitoring...");
48    cam.stop_alarm_monitoring().await?;
49    cam.close().await?;
50
51    Ok(())
52}
examples/config_management.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    cam.connect(Duration::from_secs(5)).await?;
19    cam.login(user, pass).await?;
20
21    println!("--- CONFIGURATION MANAGEMENT ---");
22
23    // 1. Get Encoding Configuration
24    println!("Retrieving Encoding Config...");
25    match cam.get_encode_info(false).await {
26        Ok(config) => println!("Current Encode Settings: {:#?}", config),
27        Err(e) => eprintln!("Error: {}", e),
28    }
29
30    // 2. Get Camera Settings
31    println!("\nRetrieving Camera Settings...");
32    match cam.get_camera_info(false).await {
33        Ok(config) => println!("Current Camera Settings: {:#?}", config),
34        Err(e) => eprintln!("Error: {}", e),
35    }
36
37    // 3. Syncing device time
38    println!("\nSyncing device time with local system time...");
39    let now = chrono::Local::now();
40    match cam.set_time(Some(now)).await {
41        Ok(true) => println!("Time synchronized to: {}", now),
42        Ok(false) => println!("Failed to sync time."),
43        Err(e) => eprintln!("Error: {}", e),
44    }
45
46    cam.close().await?;
47    Ok(())
48}
examples/account_management.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    cam.connect(Duration::from_secs(5)).await?;
19    cam.login(user, pass).await?;
20
21    println!("--- USER LIST ---");
22    match cam.get_users().await {
23        Ok(users) => {
24            for user in users {
25                let name = user
26                    .get("Name")
27                    .and_then(|n| n.as_str())
28                    .unwrap_or("Unknown");
29                let group = user.get("Group").and_then(|g| g.as_str()).unwrap_or("None");
30                println!(" - User: {} [Group: {}]", name, group);
31            }
32        }
33        Err(e) => eprintln!("Failed to get users: {}", e),
34    }
35
36    println!("\n--- GROUP LIST ---");
37    match cam.get_groups().await {
38        Ok(groups) => {
39            for group in groups {
40                let name = group
41                    .get("Name")
42                    .and_then(|n| n.as_str())
43                    .unwrap_or("Unknown");
44                println!(" - Group: {}", name);
45            }
46        }
47        Err(e) => eprintln!("Failed to get groups: {}", e),
48    }
49
50    cam.close().await?;
51    Ok(())
52}
examples/ptz_control.rs (line 16)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6    let args: Vec<String> = std::env::args().collect();
7    if args.len() < 4 {
8        println!("Usage: {} <IP> <Username> <Password>", args[0]);
9        return Ok(());
10    }
11
12    let ip = &args[1];
13    let user = &args[2];
14    let pass = &args[3];
15
16    let mut cam = DVRIPCam::new(ip);
17
18    cam.connect(Duration::from_secs(5)).await?;
19    cam.login(user, pass).await?;
20
21    println!("Performing PTZ operations...");
22
23    // 1. Step movement
24    println!("Stepping Left...");
25    cam.ptz_step(PTZCommand::DirectionLeft, 10).await?;
26    tokio::time::sleep(Duration::from_millis(500)).await;
27
28    println!("Stepping Right...");
29    cam.ptz_step(PTZCommand::DirectionRight, 10).await?;
30    tokio::time::sleep(Duration::from_millis(500)).await;
31
32    // 2. Continuous movement
33    println!("Starting continuous Up movement...");
34    cam.ptz(PTZCommand::DirectionUp, 3, -1, 0).await?;
35
36    tokio::time::sleep(Duration::from_secs(1)).await;
37
38    // 3. Zooming (using ptz_step which handles start/stop)
39    println!("Zooming Tile...");
40    cam.ptz_step(PTZCommand::ZoomTile, 4).await?;
41    tokio::time::sleep(Duration::from_secs(1)).await;
42    println!("Zooming Wide...");
43    cam.ptz_step(PTZCommand::ZoomWide, 4).await?;
44
45    // 4. Presets
46    println!("Moving to Preset 1...");
47    cam.ptz(PTZCommand::GotoPreset, 3, 1, 0).await?;
48
49    cam.close().await?;
50    println!("Done.");
51
52    Ok(())
53}
Source

pub fn with_port(self, port: u16) -> Self

Source

pub fn with_timeout(self, timeout: Duration) -> Self

Trait Implementations§

Source§

impl Alarm for DVRIPCam

Source§

fn set_alarm_callback(&mut self, callback: Option<AlarmCallback>)

Set the alarm callback function
Source§

fn clear_alarm_callback(&mut self)

Clear the alarm callback
Source§

fn start_alarm_monitoring<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start alarm monitoring
Source§

fn stop_alarm_monitoring<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop alarm monitoring
Source§

fn set_remote_alarm<'life0, 'async_trait>( &'life0 mut self, state: bool, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set remote alarm
Source§

fn is_alarm_monitoring(&self) -> bool

Check if monitoring alarms
Source§

impl Authentication for DVRIPCam

Source§

fn login<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, username: &'life1 str, password: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Login to the device
Source§

fn logout<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Logout from the device
Source§

fn is_authenticated(&self) -> bool

Check if authenticated
Source§

fn session_id(&self) -> u32

Get the session ID
Source§

fn change_password<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, old_password: &'life1 str, new_password: &'life2 str, username: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Change user password
Source§

impl Connection for DVRIPCam

Source§

fn connect<'life0, 'async_trait>( &'life0 mut self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Connect to the device
Source§

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Disconnect from the device
Source§

fn is_connected(&self) -> bool

Check if connected
Source§

fn ip(&self) -> &str

Get the device IP address
Source§

fn port(&self) -> u16

Get the device port
Source§

impl FileManagement for DVRIPCam

Source§

fn list_local_files<'life0, 'life1, 'async_trait>( &'life0 mut self, start_time: DateTime<Local>, end_time: DateTime<Local>, file_type: &'life1 str, channel: u8, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List local files on the device
Source§

fn download_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, start_time: DateTime<Local>, end_time: DateTime<Local>, filename: &'life1 str, target_path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Download a file from the device
Source§

impl Monitoring for DVRIPCam

Source§

fn start_monitor<'life0, 'life1, 'async_trait>( &'life0 mut self, callback: FrameCallback, stream: &'life1 str, channel: u8, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Start video monitoring
Source§

fn stop_monitor<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop video monitoring
Source§

fn snapshot<'life0, 'async_trait>( &'life0 mut self, channel: u8, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a snapshot (screenshot)
Source§

fn is_monitoring(&self) -> bool

Check if monitoring
Source§

impl PTZ for DVRIPCam

Source§

fn ptz<'life0, 'async_trait>( &'life0 mut self, cmd: PTZCommand, step: u8, preset: i32, channel: u8, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Control PTZ with continuous command
Source§

fn ptz_step<'life0, 'async_trait>( &'life0 mut self, cmd: PTZCommand, step: u8, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Control PTZ with single step movement
Source§

fn key_down<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Press a key (keyDown)
Source§

fn key_up<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Release a key (keyUp)
Source§

fn key_press<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Press and release a key
Source§

fn key_script<'life0, 'life1, 'async_trait>( &'life0 mut self, keys: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a key script
Source§

impl SystemInfo for DVRIPCam

Source§

fn get_system_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get general system information
Source§

fn get_general_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get general information
Source§

fn get_network_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get network information
Source§

fn get_encode_capabilities<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get encoding capabilities
Source§

fn get_system_capabilities<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get system capabilities
Source§

fn get_camera_info<'life0, 'async_trait>( &'life0 mut self, default_config: bool, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get camera information
Source§

fn get_encode_info<'life0, 'async_trait>( &'life0 mut self, default_config: bool, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get encoding information
Source§

fn get_time<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<DateTime<Local>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get current device time
Source§

fn set_time<'life0, 'async_trait>( &'life0 mut self, time: Option<DateTime<Local>>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set device time
Source§

fn get_channel_titles<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get channel titles
Source§

fn set_channel_titles<'life0, 'async_trait>( &'life0 mut self, titles: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set channel titles
Source§

fn get_channel_statuses<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get channel statuses
Source§

impl Upgrade for DVRIPCam

Source§

fn get_upgrade_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get upgrade information
Source§

fn upgrade<'life0, 'life1, 'async_trait>( &'life0 mut self, filename: &'life1 str, packet_size: usize, progress_callback: Option<UpgradeProgressCallback>, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform system upgrade
Source§

impl UserManagement for DVRIPCam

Source§

fn get_authority_list<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the list of authorities
Source§

fn get_groups<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the list of groups
Source§

fn add_group<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, name: &'life1 str, comment: &'life2 str, auth: Option<Vec<Value>>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add a new group
Source§

fn modify_group<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, name: &'life1 str, newname: Option<&'life2 str>, comment: Option<&'life3 str>, auth: Option<Vec<Value>>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Modify an existing group
Source§

fn delete_group<'life0, 'life1, 'async_trait>( &'life0 mut self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a group
Source§

fn get_users<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the list of users
Source§

fn add_user<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, name: &'life1 str, password: &'life2 str, comment: &'life3 str, group: &'life4 str, auth: Option<Vec<Value>>, sharable: bool, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Add a new user
Source§

fn modify_user<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, name: &'life1 str, newname: Option<&'life2 str>, comment: Option<&'life3 str>, group: Option<&'life4 str>, auth: Option<Vec<Value>>, sharable: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Modify an existing user
Source§

fn delete_user<'life0, 'life1, 'async_trait>( &'life0 mut self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a user

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.