fn handle_format_data_request(&self, payload: &mut Payload) -> RdpResult<Vec<Vec<u8>>> {
        let req = FormatDataRequestPDU::decode(payload)?;
        let data = match self.clipboard.get(&req.format_id) {
            Some(d) => d.clone(),
            // TODO(zmb3): send empty FORMAT_DATA_RESPONSE with RESPONSE_FAIL flag set in header
            None => {
                return Err(invalid_data_error(
                    format!(
                        "clipboard does not contain data for format {}",
                        req.format_id
                    )
                    .as_str(),
                ))
            }
        };

        Ok(vec![encode_message(
            ClipboardPDUType::CB_FORMAT_DATA_RESPONSE,
            FormatDataResponsePDU { data }.encode()?,
        )?])
    }
/// Handles a request from the RDP server for clipboard data.
/// This message is received when a user executes a paste in the remote desktop.
Handles a request from the RDP server for clipboard data.
This message is received when a user executes a paste in the remote desktop.
Handles a request from the RDP server for clipboard data . This message is received when a user executes a paste in the remote desktop .
fn handle_format_data_request(&self, payload: &mut Payload) -> RdpResult<Vec<Vec<u8>>> {
        let req = FormatDataRequestPDU::decode(payload)?;
        let data = match self.clipboard.get(&req.format_id) {
            Some(d) => d.clone(),
            // TODO(zmb3): send empty FORMAT_DATA_RESPONSE with RESPONSE_FAIL flag set in header
            None => {
                return Err(invalid_data_error(
                    format!(
                        "clipboard does not contain data for format {}",
                        req.format_id
                    )
                    .as_str(),
                ))
            }
        };
        Ok(vec![encode_message(
            ClipboardPDUType::CB_FORMAT_DATA_RESPONSE,
            FormatDataResponsePDU { data }.encode()?,
        )?])
    }
fn handle_format_data_request ( & self , payload : & mut Payload ) -> RdpResult < Vec < Vec < u8 > > > { let req = FormatDataRequestPDU :: decode ( payload ) ? ; let data = match self . clipboard . get ( & req . format_id ) { Some ( d ) => d . clone ( ) , // TODO(zmb3): send empty FORMAT_DATA_RESPONSE with RESPONSE_FAIL flag set in header None => { return Err ( invalid_data_error ( format ! ( " " req format_id ) . as_str ( ) , ) ) } } ; Ok ( vec ! [ encode_message ( ClipboardPDUType CB_FORMAT_DATA_RESPONSE FormatDataResponsePDU { data } encode ( ) ) ] ) }
Handles a request from the RDP server for clipboard data.
Handles a request from the RDP server for clipboard data .
&self
payload
&mut Payload
&self
payload
&mut Payload