Malcontent.SessionLimitsBuilder¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
p0 |
[ |
r |
|
u0 |
r |
||
u1 |
r |
||
u2 |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Malcontent.SessionLimitsBuilder¶
Malcontent.SessionLimitsBuilderis a stack-allocated mutable structure used to build anMalcontent.SessionLimitsinstance. UseMalcontent.SessionLimitsBuilder.init(), various method calls to set properties of the session limits, and thenMalcontent.SessionLimitsBuilder.end(), to construct anMalcontent.SessionLimits.Added in version 0.5.0.
- classmethod new()¶
- Returns:
a new heap-allocated
Malcontent.SessionLimitsBuilder- Return type:
Construct a new
Malcontent.SessionLimitsBuilderon the heap. This is intended for language bindings. The returned builder must eventually be freed withMalcontent.SessionLimitsBuilder.free(), but can be cleared zero or more times withMalcontent.SessionLimitsBuilder.clear() first.Added in version 0.5.0.
- clear()¶
Clear self, freeing any internal state in it. This will not free the top-level storage for self itself, which is assumed to be allocated on the stack.
If called on an already-cleared
Malcontent.SessionLimitsBuilder, this function is idempotent.Added in version 0.5.0.
- copy()¶
- Returns:
a copy of self
- Return type:
Copy the given self to a newly-allocated
Malcontent.SessionLimitsBuilderon the heap. This is safe to use with cleared, stack-allocatedMalcontent.SessionLimitsBuilders.Added in version 0.5.0.
- end()¶
- Returns:
a newly constructed
Malcontent.SessionLimits- Return type:
Finish constructing an
Malcontent.SessionLimitswith the given self, and return it. TheMalcontent.SessionLimitsBuilderwill be cleared as ifMalcontent.SessionLimitsBuilder.clear() had been called.Added in version 0.5.0.
- free()¶
Free an
Malcontent.SessionLimitsBuilderoriginally allocated usingMalcontent.SessionLimitsBuilder.new(). This must not be called on stack-allocated builders initialised usingMalcontent.SessionLimitsBuilder.init().Added in version 0.5.0.
- init()¶
Initialise the given self so it can be used to construct a new
Malcontent.SessionLimits. self must have been allocated on the stack, and must not already be initialised.Construct the
Malcontent.SessionLimitsby calling methods on self, followed byMalcontent.SessionLimitsBuilder.end(). To abort construction, useMalcontent.SessionLimitsBuilder.clear().Added in version 0.5.0.
- set_daily_schedule(start_time_secs, end_time_secs)¶
- Parameters:
Set the session limits in self to be a daily schedule, where sessions are allowed between start_time_secs and end_time_secs every day. start_time_secs and end_time_secs are given as offsets from the start of the day, in seconds. end_time_secs must be greater than start_time_secs. end_time_secs must be at most
24 * 60 * 60.This will overwrite any other session limits.
Added in version 0.5.0.
- set_none()¶
Unset any session limits currently set in the self.
Added in version 0.5.0.