pub struct FtCreateCommand { /* private fields */ }Available on crate feature
search_unfinished only.Expand description
FT.CREATE command builder.
The schema is required by FT.CREATE, so FtCreateCommand::new takes it
as a mandatory argument rather than exposing it through a builder method.
Together with SearchSchema requiring at least one field, this makes the
server’s requirements compile-time guarantees: the schema is always present
and never empty.
§Example
use redis::{schema, search::*};
let cmd = FtCreateCommand::new("my_index", schema! { "title" => SchemaTextField::new() })
.options(CreateOptions::new().on(IndexDataType::Hash))
.into_cmd();Implementations§
Source§impl FtCreateCommand
impl FtCreateCommand
Sourcepub fn new<S: Into<String>>(index: S, schema: SearchSchema) -> Self
pub fn new<S: Into<String>>(index: S, schema: SearchSchema) -> Self
Create a new FT.CREATE command for the given index and schema.
Sourcepub fn options(self, options: CreateOptions) -> Self
pub fn options(self, options: CreateOptions) -> Self
Set the options for the command
Auto Trait Implementations§
impl Freeze for FtCreateCommand
impl RefUnwindSafe for FtCreateCommand
impl Send for FtCreateCommand
impl Sync for FtCreateCommand
impl Unpin for FtCreateCommand
impl UnsafeUnpin for FtCreateCommand
impl UnwindSafe for FtCreateCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more