pub trait Utils {
const DEFAULT_ROPE_BUILDER_BUFFER_SIZE: usize = 8192;
const IS_EXTENDED: bool = true;
const NEWLINE: &str = "\n";
const READ_FROM_CLIPBOARD_COMMAND: &str = "pbpaste";
const WRITE_TO_CLIPBOARD_COMMAND: &str = "pbcopy";
Show 73 methods
// Provided methods
async fn achain<T: Future>(self, rhs: T) -> T::Output
where Self: Future + Sized { ... }
fn arc(self) -> Arc<Self>
where Self: Sized { ... }
async fn async_with<T>(self, next: impl Future<Output = T>) -> T
where Self: Future + Sized { ... }
fn as_borrowed<'a, B: ?Sized + ToOwned>(&'a self) -> &'a B
where Self: Borrow<Cow<'a, B>> { ... }
fn as_immut(&mut self) -> &Self { ... }
fn as_ptr(&self) -> *const Self { ... }
fn as_ptr_mut(&mut self) -> *mut Self { ... }
fn as_utf8(&self) -> Result<&str, Utf8Error>
where Self: AsRef<[u8]> { ... }
fn borrowed(&self) -> Cow<'_, Self>
where Self: ToOwned { ... }
fn buf_reader(self) -> BufReader<Self>
where Self: Read + Sized { ... }
fn buf_writer(self) -> BufWriter<Self>
where Self: Write + Sized { ... }
fn cast_ref<T>(&self) -> &T { ... }
fn cat<T: Display>(&self, rhs: T) -> String
where Self: Display { ... }
fn convert<T: From<Self>>(self) -> T
where Self: Sized { ... }
fn contains_eq<Q, K>(&self, query: Q) -> bool
where Self: AsRef<[K]>,
for<'a> &'a K: PartialEq<Q> { ... }
fn copied(&self) -> Self
where Self: Copy + Sized { ... }
fn create(&self) -> Result<File, IoError>
where Self: AsRef<Path> { ... }
fn create_dir_all(&self) -> Result<(), IoError>
where Self: AsRef<Path> { ... }
fn err<T>(self) -> Result<T, Self>
where Self: Sized { ... }
fn find_eq<Q, K>(&self, query: Q) -> Option<(usize, &K)>
where Self: AsRef<[K]>,
for<'a> &'a K: PartialEq<Q> { ... }
fn has_happened(self) -> bool
where Self: Is<Instant> { ... }
fn if_else<T>(self, true_value: T, false_value: T) -> T
where Self: Is<bool> { ... }
fn immutable(&mut self) -> &Self { ... }
fn inc(&self) -> usize
where Self: Borrow<AtomicUsize> { ... }
fn insert_mut<'a, K: 'a + Eq + Hash, V>(
&'a mut self,
key: K,
value: V,
) -> &'a mut V
where Self: BorrowMut<HashMap<K, V>> { ... }
fn into_box(self) -> Box<Self>
where Self: Sized { ... }
fn into_break<C>(self) -> ControlFlow<Self, C>
where Self: Sized { ... }
fn into_continue<B>(self) -> ControlFlow<B, Self>
where Self: Sized { ... }
fn into_manually_drop(self) -> ManuallyDrop<Self>
where Self: Sized { ... }
fn io_error(self) -> IoError
where Self: Into<Box<dyn StdError + Send + Sync>> { ... }
fn io_result<T, E: Into<Box<dyn StdError + Send + Sync>>>(
self,
) -> Result<T, IoError>
where Self: Is<Result<T, E>> { ... }
fn is_less_than<T: PartialOrd>(self, rhs: T) -> bool
where Self: Into<T> { ... }
fn map_collect<Y, T: FromIterator<Y>>(
self,
func: impl FnMut(Self::Item) -> Y,
) -> T
where Self: IntoIterator + Sized { ... }
fn map_into<Y, X: Into<Y>>(self) -> Option<Y>
where Self: Is<Option<X>> { ... }
fn map_as_ref<'a, Y: ?Sized, X: 'a + AsRef<Y>>(&'a self) -> Option<&'a Y>
where Self: Borrow<Option<X>> { ... }
fn mem_drop(self)
where Self: Sized { ... }
fn mem_replace(&mut self, value: Self) -> Self
where Self: Sized { ... }
fn mem_take(&mut self) -> Self
where Self: Default { ... }
fn mut_push<T>(&mut self, item: T) -> &mut T
where Self: BorrowMut<Vec<T>> { ... }
fn ok<E>(self) -> Result<Self, E>
where Self: Sized { ... }
fn once(self) -> Once<Self>
where Self: Sized { ... }
fn open(&self) -> Result<File, IoError>
where Self: AsRef<Path> { ... }
fn owned<B: ?Sized + ToOwned<Owned = Self>>(self) -> Cow<'static, B>
where Self: Sized { ... }
fn pair<T>(self, rhs: T) -> (Self, T)
where Self: Sized { ... }
fn pin(self) -> Pin<Box<Self>>
where Self: Sized { ... }
fn pipe<X, Y, Z, F: FnMut(Y) -> Z>(self, func: F) -> impl FnMut(X) -> Z
where Self: Sized + FnMut(X) -> Y { ... }
fn poll_ready(self) -> Poll<Self>
where Self: Sized { ... }
fn pipe_into<T, F: FnOnce(Self) -> T>(self, func: F) -> T
where Self: Sized { ... }
fn println(&self)
where Self: Display { ... }
fn print(&self)
where Self: Display { ... }
fn push_to<T: Extend<Self>>(self, collection: &mut T)
where Self: Sized { ... }
fn push_all_to<T: Extend<Self::Item>>(self, collection: &mut T)
where Self: IntoIterator + Sized { ... }
fn range_from_len(self, len: Self) -> Range<Self>
where Self: Add<Output = Self> + Copy { ... }
fn ready(self) -> Ready<Self>
where Self: Sized { ... }
fn ref_immut(&self) -> &Self { ... }
fn ref_mut(&mut self) -> &mut Self { ... }
fn repeat(self) -> Repeat<Self>
where Self: Clone { ... }
fn reversed<X, Y>(self) -> (Y, X)
where Self: Is<(X, Y)> { ... }
fn remove_file(&self) -> Result<(), IoError>
where Self: AsRef<Path> { ... }
fn set_true(&mut self) -> bool
where Self: BorrowMut<bool> { ... }
fn set_false(&mut self) -> bool
where Self: BorrowMut<bool> { ... }
fn some(self) -> Option<Self>
where Self: Sized { ... }
fn substr_interval(&self, query: &[u8]) -> Option<(usize, usize)>
where Self: AsRef<[u8]> { ... }
fn toggle(&mut self)
where Self: BorrowMut<bool> { ... }
fn try_convert<T: TryFrom<Self>>(self) -> Result<T, T::Error>
where Self: Sized { ... }
fn type_name() -> &'static str { ... }
fn unit(&self) { ... }
async fn wait_then_unwrap_or_pending<T>(self) -> T
where Self: Future<Output = Option<T>> + Sized { ... }
async fn unwrap_or_pending_then_wait<F: Future + Unpin>(
&mut self,
) -> F::Output
where Self: BorrowMut<Option<F>> { ... }
fn with<T>(&self, value: T) -> T { ... }
fn with_item_pushed<T>(self, item: T) -> Vec<T>
where Self: Is<Vec<T>> { ... }
fn with_str_pushed(self, rhs: &str) -> String
where Self: Is<String> { ... }
fn write_all_then(&mut self, byte_str: &[u8]) -> Result<&mut Self, IoError>
where Self: Write { ... }
}Provided Associated Constants§
const DEFAULT_ROPE_BUILDER_BUFFER_SIZE: usize = 8192
const IS_EXTENDED: bool = true
const NEWLINE: &str = "\n"
const READ_FROM_CLIPBOARD_COMMAND: &str = "pbpaste"
const WRITE_TO_CLIPBOARD_COMMAND: &str = "pbcopy"
Provided Methods§
async fn achain<T: Future>(self, rhs: T) -> T::Output
fn arc(self) -> Arc<Self>where
Self: Sized,
async fn async_with<T>(self, next: impl Future<Output = T>) -> T
fn as_borrowed<'a, B: ?Sized + ToOwned>(&'a self) -> &'a B
fn as_immut(&mut self) -> &Self
fn as_ptr(&self) -> *const Self
fn as_ptr_mut(&mut self) -> *mut Self
fn as_utf8(&self) -> Result<&str, Utf8Error>
fn borrowed(&self) -> Cow<'_, Self>where
Self: ToOwned,
fn buf_reader(self) -> BufReader<Self>
fn buf_writer(self) -> BufWriter<Self>
fn cast_ref<T>(&self) -> &T
fn cat<T: Display>(&self, rhs: T) -> Stringwhere
Self: Display,
fn convert<T: From<Self>>(self) -> Twhere
Self: Sized,
fn contains_eq<Q, K>(&self, query: Q) -> bool
fn copied(&self) -> Self
fn create(&self) -> Result<File, IoError>
fn create_dir_all(&self) -> Result<(), IoError>
fn err<T>(self) -> Result<T, Self>where
Self: Sized,
fn find_eq<Q, K>(&self, query: Q) -> Option<(usize, &K)>
fn has_happened(self) -> boolwhere
Self: Is<Instant>,
fn if_else<T>(self, true_value: T, false_value: T) -> Twhere
Self: Is<bool>,
fn immutable(&mut self) -> &Self
fn inc(&self) -> usizewhere
Self: Borrow<AtomicUsize>,
fn insert_mut<'a, K: 'a + Eq + Hash, V>( &'a mut self, key: K, value: V, ) -> &'a mut V
fn into_box(self) -> Box<Self>where
Self: Sized,
fn into_break<C>(self) -> ControlFlow<Self, C>where
Self: Sized,
fn into_continue<B>(self) -> ControlFlow<B, Self>where
Self: Sized,
fn into_manually_drop(self) -> ManuallyDrop<Self>where
Self: Sized,
fn io_error(self) -> IoError
fn io_result<T, E: Into<Box<dyn StdError + Send + Sync>>>(
self,
) -> Result<T, IoError>where
Self: Is<Result<T, E>>,
fn is_less_than<T: PartialOrd>(self, rhs: T) -> boolwhere
Self: Into<T>,
fn map_collect<Y, T: FromIterator<Y>>(
self,
func: impl FnMut(Self::Item) -> Y,
) -> Twhere
Self: IntoIterator + Sized,
fn map_into<Y, X: Into<Y>>(self) -> Option<Y>where
Self: Is<Option<X>>,
fn map_as_ref<'a, Y: ?Sized, X: 'a + AsRef<Y>>(&'a self) -> Option<&'a Y>
fn mem_drop(self)where
Self: Sized,
fn mem_replace(&mut self, value: Self) -> Selfwhere
Self: Sized,
fn mem_take(&mut self) -> Selfwhere
Self: Default,
fn mut_push<T>(&mut self, item: T) -> &mut T
fn ok<E>(self) -> Result<Self, E>where
Self: Sized,
fn once(self) -> Once<Self>where
Self: Sized,
fn open(&self) -> Result<File, IoError>
fn owned<B: ?Sized + ToOwned<Owned = Self>>(self) -> Cow<'static, B>where
Self: Sized,
fn pair<T>(self, rhs: T) -> (Self, T)where
Self: Sized,
fn pin(self) -> Pin<Box<Self>>where
Self: Sized,
fn pipe<X, Y, Z, F: FnMut(Y) -> Z>(self, func: F) -> impl FnMut(X) -> Z
fn poll_ready(self) -> Poll<Self>where
Self: Sized,
fn pipe_into<T, F: FnOnce(Self) -> T>(self, func: F) -> Twhere
Self: Sized,
fn println(&self)where
Self: Display,
fn print(&self)where
Self: Display,
fn push_to<T: Extend<Self>>(self, collection: &mut T)where
Self: Sized,
fn push_all_to<T: Extend<Self::Item>>(self, collection: &mut T)where
Self: IntoIterator + Sized,
fn range_from_len(self, len: Self) -> Range<Self>
fn ready(self) -> Ready<Self>where
Self: Sized,
fn ref_immut(&self) -> &Self
fn ref_mut(&mut self) -> &mut Self
fn repeat(self) -> Repeat<Self>where
Self: Clone,
fn reversed<X, Y>(self) -> (Y, X)where
Self: Is<(X, Y)>,
fn remove_file(&self) -> Result<(), IoError>
fn set_true(&mut self) -> bool
fn set_false(&mut self) -> bool
fn some(self) -> Option<Self>where
Self: Sized,
fn substr_interval(&self, query: &[u8]) -> Option<(usize, usize)>
fn toggle(&mut self)
fn try_convert<T: TryFrom<Self>>(self) -> Result<T, T::Error>where
Self: Sized,
fn type_name() -> &'static str
fn unit(&self)
async fn wait_then_unwrap_or_pending<T>(self) -> T
async fn unwrap_or_pending_then_wait<F: Future + Unpin>(&mut self) -> F::Output
fn with<T>(&self, value: T) -> T
fn with_item_pushed<T>(self, item: T) -> Vec<T>where
Self: Is<Vec<T>>,
fn with_str_pushed(self, rhs: &str) -> Stringwhere
Self: Is<String>,
fn write_all_then(&mut self, byte_str: &[u8]) -> Result<&mut Self, IoError>where
Self: Write,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.