pub fn search_once_to_device(
    options: Options,
    device_address: SocketAddr,
) -> Result<Vec<Response>, Error> {
    info!(
        "search_once_to_device - options: {:?}, device_address: {:?}",
        options, device_address
    );
    options.validate()?;
    if options.spec_version >= SpecVersion::V11 {
        let mut message_builder = RequestBuilder::new(protocol::METHOD_SEARCH);
        message_builder
            .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
            .add_header(protocol::HEAD_MAN, protocol::HTTP_EXTENSION)
            .add_header(protocol::HEAD_ST, &options.search_target.to_string())
            .add_header(
                protocol::HEAD_USER_AGENT,
                &user_agent::make(&options.spec_version, &options.product_and_version),
            );

        let raw_responses = multicast(&message_builder.into(), &device_address, &options.into())?;

        let mut responses: Vec<Response> = Vec::new();
        for raw_response in raw_responses {
            responses.push(raw_response.try_into()?);
        }
        Ok(responses)
    } else {
        Err(Error::Unsupported)
    }
}
///
/// Perform a unicast search and return the results immediately as a vector, not wrapped
/// in a cache.
///
/// The search function can be configured using the [`Options`](struct.Options.html) struct,
/// although the defaults are reasonable for most clients.
///
/// # Specification
///
/// TBD
///
/// # Parameters
///
/// * `options` - protocol options such as the specification version to use and any network
/// configuration values.
/// * `device_address` - the address of the device to query.
///
///
Perform a unicast search and return the results immediately as a vector, not wrapped
in a cache.

The search function can be configured using the [`Options`](struct.Options.html) struct,
although the defaults are reasonable for most clients.
Perform a unicast search and return the results immediately as a vector not wrapped in a cache . The search function can be configured using the [ ` Options ` ] ( struct . Options . html ) struct although the defaults are reasonable for most clients .
pub fn search_once_to_device(
    options: Options,
    device_address: SocketAddr,
) -> Result<Vec<Response>, Error> {
    info!(
        "search_once_to_device - options: {:?}, device_address: {:?}",
        options, device_address
    );
    options.validate()?;
    if options.spec_version >= SpecVersion::V11 {
        let mut message_builder = RequestBuilder::new(protocol::METHOD_SEARCH);
        message_builder
            .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
            .add_header(protocol::HEAD_MAN, protocol::HTTP_EXTENSION)
            .add_header(protocol::HEAD_ST, &options.search_target.to_string())
            .add_header(
                protocol::HEAD_USER_AGENT,
                &user_agent::make(&options.spec_version, &options.product_and_version),
            );
        let raw_responses = multicast(&message_builder.into(), &device_address, &options.into())?;
        let mut responses: Vec<Response> = Vec::new();
        for raw_response in raw_responses {
            responses.push(raw_response.try_into()?);
        }
        Ok(responses)
    } else {
        Err(Error::Unsupported)
    }
}
pub fn search_once_to_device ( options : Options , device_address : SocketAddr , ) -> Result < Vec < Response > , Error > { info ! ( " " options device_address ) ; options . validate ( ) ? ; if options . spec_version >= SpecVersion :: V11 { let mut message_builder = RequestBuilder :: new ( protocol :: METHOD_SEARCH ) ; message_builder . add_header ( protocol :: HEAD_HOST , protocol :: MULTICAST_ADDRESS ) . add_header ( protocol :: HEAD_MAN , protocol :: HTTP_EXTENSION ) . add_header ( protocol :: HEAD_ST , & options . search_target . to_string ( ) ) . add_header ( protocol :: HEAD_USER_AGENT , & user_agent :: make ( & options . spec_version , & options . product_and_version ) , ) ; let raw_responses = multicast ( & message_builder . into ( ) , & device_address , & options . into ( ) ) ? ; let mut responses : Vec < Response > = Vec :: new ( ) ; for raw_response in raw_responses { responses . push ( raw_response . try_into ( ) ? ) ; } Ok ( responses ) } else { Err ( Error :: Unsupported ) } }
Perform a unicast search and return the results immediately as a vector, not wrapped
in a cache.
Perform a unicast search and return the results immediately as a vector not wrapped in a cache .
options
Options
device_address
SocketAddr
options
Options
device_address
SocketAddr
specification
None