Diesel: Case-Insensitive Comparison in Diesel

Is it possible to make a Diesel DSL query that uses a case-insensitive comparison in PostgreSQL?

I have the following index in PostgreSQl:

create unique index if not exists ux_user_lower_logon_name 
   on lzd.user ( lower(logon_name) );

I'd like the following DSL query to use that index:

user
     .filter(lower(logon_name).eq(name.to_lowercase()))
     .select(models::User::as_select())
     .first(&mut conn)
     .await

Now, it appears the lower does not exist as a DSL function. How do I do something like this in Diesel? I can't seem to find anything in the documentation.

Is this just a new feature that needs implemented?

I think the right answer is the following:

        define_sql_function!(fn lower(a: diesel::sql_types::VarChar) -> diesel::sql_types::VarChar);
        match user
            .filter(lower(logon_name).eq(lower(name)))
            .select(models::User::as_select())
            .first(&mut conn)
            .await
        {
            Ok(loaded_user) => Ok(Some(loaded_user)),
            Err(diesel::result::Error::NotFound) => Ok(None),
            Err(err) => Err(err.into()),
        }