It takes a closure as filter and returns and Option<usize> where that usize is an index in the CStr if the return is none then the character(or u8 in this case) is not present.
Now, if you want to support UTF-8 you will need first convert your CStr to a &str or String, you can achieve that with the to_str method or with to_string_lossy then you can apply the above of this manner: