Skip to main content

ok

Function ok 

Source
pub fn ok<T, E>(val: T) -> Ready<Result<T, E>> โ“˜
๐Ÿ‘ŽDeprecated since 3.0.2:

Use core::future::ready(Ok(val)) instead.

Expand description

Creates a future that is immediately ready with a success value.

ยงExamples

use actix_utils::future::ok;

let a = ok::<_, ()>(1);
assert_eq!(a.await, Ok(1));