1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use super::{Command, Response};
use {Adapter, CommandType, ObjectHandle, ObjectId, ObjectInfo, ObjectType, Session, SessionError};
pub fn get_object_info<A: Adapter>(
session: &mut Session<A>,
object_id: ObjectId,
object_type: ObjectType,
) -> Result<ObjectInfo, SessionError> {
session
.send_command(GetObjectInfoCommand(ObjectHandle::new(
object_id,
object_type,
))).map(|response| response.0)
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct GetObjectInfoCommand(pub(crate) ObjectHandle);
impl Command for GetObjectInfoCommand {
type ResponseType = GetObjectInfoResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct GetObjectInfoResponse(pub(crate) ObjectInfo);
impl Response for GetObjectInfoResponse {
const COMMAND_TYPE: CommandType = CommandType::GetObjectInfo;
}