Struct minigrep_fracoxza::Config[][src]

pub struct Config {
    pub query: String,
    pub filename: String,
    pub case_sensitive: bool,
}

Estructura de configuración que se utiliza como parámetro para la función search

Fields

query: String

Guardara el patron que se necesita buscar

filename: String

Guardara el nombre del archivo a escanear

case_sensitive: bool

Servirá para hacer una búsqueda que distinga entre mayúsculas en caso de ser false, por el caso contrario solo devolverá cadenas que coincidan en capitalización

Implementations

impl Config[src]

Implementación de la configuración que contiene Métodos esenciales para el funcionamiento del programa.

pub fn new(args: Args) -> Result<Config, &'static str>[src]

Función constructora encargada de inicializar una instancia de Config, recibe los en los argumentos el tipo env::Args que consiste en las opciones que se ingresa junto con el comando.

Errors

En caso de que no se ingrese ningún argumento al llamar a la función se retornara el error, “Didn’t get a query string” Si se ingresan todo funciona correctamente se retornara un OK, con la estructura Config iniciada.

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.