little-kitty 0.0.3

A low-level interface for the Kitty Graphics Protocol
Documentation
use super::super::command::*;

use std::io;

/// Execute release image command.
pub fn release_image(id: usize) -> io::Result<()> {
    Command::default()
        // quiet (suppress OK and error responses)
        .with_control('q', 2)
        // action = delete
        .with_control('a', 'd')
        // delete by ID (uppercase = release)
        .with_control('d', 'I')
        // ID
        .with_control('i', id)
        .execute()
        .map(|_| ())
}

/// Execute delete placement command.
pub fn delete_placement(id: usize, placement_id: usize) -> io::Result<()> {
    Command::default()
        // quiet (suppress OK and error responses)
        .with_control('q', 2)
        // action = delete
        .with_control('a', 'd')
        // delete by ID
        .with_control('d', 'i')
        // ID
        .with_control('i', id)
        // placement ID
        .with_control('p', placement_id)
        .execute()
        .map(|_| ())
}