adguard-flm 2.6.2

This crate represents a library for managing AdGuard filter lists
Documentation
//! Filters update result models.
use crate::FilterId;
use crate::FullFilterList;

/// Filters update result container.
#[derive(Default)]
pub struct UpdateResult {
    /// Currently updated filters.
    /// `title` and `description` fields will be localised with current [`crate::Locale`]
    pub updated_list: Vec<FullFilterList>,
    /// Number of filters not updated due to timeout.
    pub remaining_filters_count: i32,
    /// List of entities containing the filter id and a string representation of the error
    /// that occurred when processing or receiving the filter
    pub filters_errors: Vec<UpdateFilterError>,
}

/// Container for filter updating error
pub struct UpdateFilterError {
    /// ID of that filter tha couldn't be updated
    pub filter_id: FilterId,
    /// Filter error converted to a string. For debugging purposes
    pub message: String,
    /// Filter url
    pub filter_url: Option<String>,
    /// Http client error
    pub http_client_error: Option<String>,
}

impl UpdateFilterError {
    /// Creates a new [`UpdateFilterError`] only with the specified message.
    pub const fn with_message(message: String) -> Self {
        Self {
            filter_id: 0,
            message,
            filter_url: None,
            http_client_error: None,
        }
    }
}