pub struct Cohort {
pub id: Option<String>,
pub hint: Option<String>,
pub name: Option<String>,
}
Expand description
The cohort identifies the update ‘track’ or ‘channel’, and is used to implement the tracking of membership in a fractional roll-out. This is per-application data.
This is sent to Omaha to identify the cohort that the application is in. This is returned (with possibly new values) by Omaha to indicate that the application is now in a different cohort. On the next update check for that application, the updater needs to use this newly returned cohort as the one that it sends to Omaha with that application.
For more information about cohorts, see the ‘cohort’, ‘cohorthint’, and ‘cohortname’ attributes of the Request.App object at:
https://github.com/google/omaha/blob/HEAD/doc/ServerProtocolV3.md#app-request
Fields§
§id: Option<String>
This is the cohort id itself.
hint: Option<String>
§name: Option<String>
Implementations§
Source§impl Cohort
impl Cohort
Sourcepub fn new(id: &str) -> Cohort
pub fn new(id: &str) -> Cohort
Create a new Cohort instance from just a cohort id (channel name).
pub fn from_hint(hint: &str) -> Cohort
pub fn update_from_omaha(&mut self, omaha_cohort: Self)
Sourcepub fn validate_name(name: &str) -> bool
pub fn validate_name(name: &str) -> bool
A validation function to test that a given Cohort hint or name is valid per the Omaha spec: 1-1024 ascii characters, with values in the range [\u20-\u7e].
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cohort
impl<'de> Deserialize<'de> for Cohort
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Cohort
impl StructuralPartialEq for Cohort
Auto Trait Implementations§
impl Freeze for Cohort
impl RefUnwindSafe for Cohort
impl Send for Cohort
impl Sync for Cohort
impl Unpin for Cohort
impl UnwindSafe for Cohort
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)