pub fn new(path: &str) -> Result<Interface> {
        let cstring  = ffi::CString::new(path).unwrap();
        let handle = unsafe { j2534_load(cstring.as_ptr()) };
        if handle.is_null() {
            return Err(Error{kind: ErrorKind::NotFound});
        }
        Ok(Interface{handle})
    }
/// Returns a J2534 library given the path
/// 
/// # Arguments
/// 
/// * `path` - The absolute path to the J2534 shared library
/// 
/// # Example
/// ```
/// use j2534::Interface;
/// let interface = Interface::new("C:\\j2534_driver.dll").unwrap();
/// ```
Returns a J2534 library given the path
Returns a J2534 library given the path
pub fn new(path: &str) -> Result<Interface> {
        let cstring  = ffi::CString::new(path).unwrap();
        let handle = unsafe { j2534_load(cstring.as_ptr()) };
        if handle.is_null() {
            return Err(Error{kind: ErrorKind::NotFound});
        }
        Ok(Interface{handle})
    }
pub fn new ( path : & str ) -> Result < Interface > { let cstring = ffi :: CString :: new ( path ) . unwrap ( ) ; let handle = unsafe { j2534_load ( cstring . as_ptr ( ) ) } ; if handle . is_null ( ) { return Err ( Error { kind : ErrorKind :: NotFound } ) ; } Ok ( Interface { handle } ) }
Returns a J2534 library given the path
Returns a J2534 library given the path
path
&str
path
&str
example
None